Skip to content

Fix options page#93

Open
PSMJonas wants to merge 1 commit into
valu-digital:masterfrom
PSMJonas:master
Open

Fix options page#93
PSMJonas wants to merge 1 commit into
valu-digital:masterfrom
PSMJonas:master

Conversation

@PSMJonas

Copy link
Copy Markdown

The output of the content based on the selected language did not work because the type attribute was not present:

$type = $source['type'] ?? null;
return $type === 'options_page';

$type is always null.

@geck1942

Copy link
Copy Markdown

This DOES fix the issue! Nice call.-
Beware in the commit, you've removed is_options_page but it is still called line 150

@Aku-benj

Aku-benj commented Sep 23, 2024

Copy link
Copy Markdown

The resolver is executed on all queries, maybe we could keep the function is_options_page and compare the class of the 'node' attribute ?

Something like :

$type = $source['type'] ?? null;
$class_name = isset($source['node']) ? get_class($source['node']) : null;
return $type === 'options_page' || $class_name == \WPGraphQL\Acf\Model\AcfOptionsPage::class;

@jponsen

jponsen commented Jan 8, 2025

Copy link
Copy Markdown

I've just checked the snippet above, it seems to work indeed. However, I am not familiar enough with the plugin to implement this and understand the consequences. Can someone with more experience verify this and merge this so the issue can be solved?

@sjaakbanaan

Copy link
Copy Markdown

Can this fix be implemented please? So we can stop using a mirror plugin with just this fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants