WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#31641 closed defect (bug) (fixed)

Theme Preview using "Customize.php" error

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

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
4 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 4 years ago by selnomeria (previous) (diff)

#2 @westonruter
4 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
4 years ago

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

#4 @SergeyBiryukov
4 years ago

  • Component changed from General to Customize

#5 @celloexpressions
3 years ago

  • Keywords needs-patch added
  • Version set to 3.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
3 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
3 years ago

  • Milestone changed from Awaiting Review to Future Release

#8 in reply to: ↑ 6 @dlh
3 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
3 years ago

  • Keywords needs-patch removed
  • Milestone changed from Future Release to 4.7
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.