Ticket #6529 (new defect)

Opened 8 months ago

Last modified 4 months ago

Cannot edit page-slug before publishing

Reported by: tibc Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: Administration Version: 2.5
Severity: major Keywords: page slug permalink
Cc:

Description

Only after publishing a new PAGE will the permalink display and become editable.

First reported as a RC bug in ticket #6416, the issue was quickly dismissed as invalid because it could not be duplicated.

I confirm that this is a problem in 2.5 final. I have seen this on different pc's, using different browsers (IE7, FF, and Safari), in different installs of WP2.5 (including one absolutely clean and new installation), on different hosts (including one WAMP server).

The problem exists only with a new PAGE. The new POST function works as designed.

Skeptics should see the attached screen capture.

Attachments

page-slug-missing.jpg (59.4 kB) - added by tibc on 04/01/08 18:29:57.
screen capture of missing page slug/permalink
patch.diff (1.0 kB) - added by MattyRob on 05/06/08 20:05:22.

Change History

04/01/08 18:29:57 changed by tibc

  • attachment page-slug-missing.jpg added.

screen capture of missing page slug/permalink

04/01/08 20:02:37 changed by fitztrev

Confirmed.

04/02/08 13:37:31 changed by markjaquith

04/02/08 14:22:43 changed by MichaelH

04/02/08 14:24:43 changed by Nazgul

  • milestone set to 2.6.

(in reply to: ↑ description ) 04/02/08 15:50:45 changed by sfeather

Experiencing the same problem here. I can create a screencast to prove it, since there seems to be an air of "works fine for me so isn't a problem".

What information do the devs need to help to actually pinpoint why this occurs on some systems and not on others?

04/02/08 21:54:34 changed by fitztrev

It seems like the same process is applied on post-new.php and it works without a problem there. However, on page-new.php, that's where the issue is.

It appears the AJAX POST request to admin-ajax.php isn't coming back with a response. When the request, with action 'sample-permalink', is sent, nothing is received. Firebug just says "Loading..." when inspecting the current javascript processes.

04/06/08 05:43:47 changed by link2caro

  • milestone changed from 2.6 to 2.5.1.

I did make a ticket for this issue, and just found this ticket, I just want to add an information:

I have WordPress 2.5 work on 3 servers, two work well with the Page slug (dedicated servers) and another is a hosting from 1and1 where the Page slug does not work.

04/10/08 05:35:32 changed by tai

Reproduced with PHP 4.3.3, but not with 5.2.3. It may be specific to the PHP version.

04/10/08 13:30:54 changed by link2caro

Issue produced with 4.4.8 Non with 5.2.5

Requirement for WP2.5 perhaps should be PHP 5, j/k

04/12/08 04:26:48 changed by GamerZ

seconded link2caro, problem does not appear to be in PHP 5.2.5

04/28/08 00:13:34 changed by chrismou

I'm running WP 2.5 on the Media Temple grid server, PHP 5.2.5.

I came across this ticket because I was having this exact problem with a page I built last week - couldn't get the edit slug link to appear until after I'd published.

BUT Ive just tried to recreate it and suddenly.. its working fine. I have no clue what I did differently, but Ive made no changes to any of the files on my server since before I noticed the problem. I don't think Ive deactivated any plugins in the meantime, but I'll look into that a bit further when I get a chance...

05/01/08 01:36:50 changed by dstebila

I have this problem as well on WP 2.5.1 on PHP 4.4.1.

Although I am not very familiar with the WP internals, I have come up with two possible workarounds. These work for me, but could damage your system so be careful. I believe Approach 1 is safer because it only changes the presentation on the Javascript level, whereas Approach 2 messes with the internals of a PHP function.

Approach 1: Re-enable the slug field for pages. In the file wp-admin/js/page.js, change the line

jQuery('#pageslugdiv').hide();

to

// jQuery('#pageslugdiv').hide();

Approach 2: Try to fix the permalink box for draft pages. In the file wp-admin/includes/post.php, change the following lines

		$uri = get_page_uri($post->ID);
		$uri = untrailingslashit($uri);
		$uri = strrev( stristr( strrev( $uri ), '/' ) );
		$uri = untrailingslashit($uri);
		if ( !empty($uri) )
			$uri .='/';
		$permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);

to

		if (in_array($original_status, array('draft', 'pending'))) {
			$permalink = '%pagename%';
		} else {
			$uri = get_page_uri($post->ID);
			$uri = untrailingslashit($uri);
			$uri = strrev( stristr( strrev( $uri ), '/' ) );
			$uri = untrailingslashit($uri);
			if ( !empty($uri) )
				$uri .='/';
			$permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
		}

05/06/08 20:04:58 changed by MattyRob

Having compared the post.js file with the page.js file the jQuery commands are specified in a different order. I cannot reproduce this issue but have attached a patch the alters the command order in page.js to match the order in post.js

This might be worth applying and testing.

05/06/08 20:05:22 changed by MattyRob

  • attachment patch.diff added.

07/15/08 16:24:07 changed by ryan

  • milestone changed from 2.5.2 to 2.9.

Milestone 2.5.2 deleted

07/18/08 19:34:52 changed by mrmist

Also a bug (with 2.6) on PHP 4.3.9 but not seen on 5.2.5.

I applied the patch diff (to the broken one) but it had no effect.