Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizer: Social Links crud-moule-part tmpl fetching error when live previewing a child-theme #1560

Closed
eri-trabiccolo opened this issue Jun 26, 2018 · 3 comments
Labels
1-cs 2-ms bug Triage 2019 Triage 2019. Closed issues will be used as references for more recent ones.

Comments

@eri-trabiccolo
Copy link
Collaborator

reported here:
https://wordpress.org/support/topic/having-customizr-child-theme-issue/

This issue, as far as I can see, ONLY happens when previewing a child-theme of this very theme.
And except for the social links, from a global look, I can see the other options working fine (always when live previewing the child-theme).
I cannot spot any PHP error.
So I don't think this is critical.

The user report also refers to a blank preview issue, which I don't think is related to this to be honest.
As we know blank preview are related to server side issues, PHP fatal errors/memory exhausting etc. etc.

@ghost
Copy link

ghost commented Jun 26, 2018

thanks for opening the issue :)

OK.

@eri-trabiccolo
Copy link
Collaborator Author

Ah, forgot to add ... the true error

"invalid_nonce"
message
:
"ac_set_ajax_czr_tmpl => Security check failed."

@eri-trabiccolo
Copy link
Collaborator Author

eri-trabiccolo commented Jun 26, 2018

Ok, went a little through this issue.
Basically, from what I understood, the customizer manager creates the nonce in its method get_nonces:

	public function get_nonces() {
		$nonces = array(
			'save' => wp_create_nonce( 'save-customize_' . $this->get_stylesheet() ),
			'preview' => wp_create_nonce( 'preview-customize_' . $this->get_stylesheet() ),
			'switch_themes' => wp_create_nonce( 'switch_themes' ),
			'dismiss_autosave_or_lock' => wp_create_nonce( 'customize_dismiss_autosave_or_lock' ),
			'override_lock' => wp_create_nonce( 'customize_override_changeset_lock' ),
			'trash' => wp_create_nonce( 'trash_customize_changeset' ),
		);

There, when previewing a non active child-theme, $this->get_stylesheet() returns the child-theme stylesheet, while here (ajaxing):
https://github.com/presscustomizr/czr-base-fmk/blob/master/_dev_php/0_2_czr-base-fmk-ajax_filter.php#L37

get_stylesheet returns the current active theme stylesheet. Hence the security check failing
(we use a similar check in the content picker)

@ghost ghost added the wontfix label Nov 28, 2019
@ghost ghost closed this as completed Nov 28, 2019
@ghost ghost added Triage 2019 Triage 2019. Closed issues will be used as references for more recent ones. and removed wontfix labels Nov 28, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-cs 2-ms bug Triage 2019 Triage 2019. Closed issues will be used as references for more recent ones.
Projects
None yet
Development

No branches or pull requests

1 participant