Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#31641 closed defect (bug) (fixed)

Theme Preview using "Customize.php" error

Reported by: selnomeria Owned by:
Priority: normal Milestone: 4.7
Component: Customize Version: 3.4
Severity: normal Keywords:
Cc: Focuses:

Description

Hello.
Whenever my homepage is set to be 301 redirected to i.e. mysite.com/somepage, then when Under Appearence(in Dashboard), i click "Customize", then on the right side of the preview window,it doesnt show anything. It is blank.
see preview - http://i.imgur.com/6c00M2f.png

Change History (9)

#1 @selnomeria
11 years ago

As i see, that the first time, the customize.php is loaded, and after that, the website php is loaded separately, then I am forced to use this trick in my theme's functions.php, to avoid that problem(because cookies are read on the next execution of the page):

if (strpos($_SERVER['REQUEST_URI'], '/wp-admin/customize.php?return=') !== false)	{setcookie('my_Redirect', 'disable', time()+100000000, '/');}
else	                                                                                {setcookie('my_Redirect', 'enable', time()+100000000, '/');}

....

//then here is my redirection code
if ('disable' != $_COOKIE['my_Redirect']) {..REDIRECT..}
Last edited 11 years ago by selnomeria (previous) (diff)

#2 @westonruter
11 years ago

There is some support in the Customizer for redirects: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/js/customize-controls.js#L1999

However, perhaps it is not working for initial load.

#3 @selnomeria
11 years ago

i cant make it work.. i am not proffesional in this case.

#4 @SergeyBiryukov
11 years ago

  • Component GeneralCustomize

#5 @celloexpressions
10 years ago

  • Keywords needs-patch added
  • Version3.4

I can confirm that the preview fails to load if there is a 301 redirect in place, even if it still points to the same domain, just another page on the site. I'm not sure whether or not this is even something we could fix, though.

#6 follow-up: @westonruter
10 years ago

This will probably be resolved with #30028. I suspect the POST data in the Ajax request is getting lost in the redirect, perhaps.

#7 @celloexpressions
10 years ago

  • Milestone Awaiting ReviewFuture Release

#8 in reply to: ↑ 6 @dlh
10 years ago

Replying to westonruter:

This will probably be resolved with #30028. I suspect the POST data in the Ajax request is getting lost in the redirect, perhaps.

I couldn't replicate the bug after applying [38810], which suggests this comment was correct.

#9 @SergeyBiryukov
10 years ago

  • Keywords needs-patch removed
  • Milestone Future Release4.7
  • Resolutionfixed
  • Status newclosed
Note: See TracTickets for help on using tickets.