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

Cms Page Links won't be set when they are loaded over GraphQl #2

Open
MarianNapi opened this issue Oct 20, 2021 · 3 comments
Open

Cms Page Links won't be set when they are loaded over GraphQl #2

MarianNapi opened this issue Oct 20, 2021 · 3 comments

Comments

@MarianNapi
Copy link

When trying to retrieve a CMS Page over the cmsPage query the links aren't set.

This occurres because in MageWorx\SeoCrossLinks\Model\Observer\AddCrosslinksToPageObserver on line 117 the request FullActionName is compared to a hardcoded 'cms_page_view'. In GraphQl the FullActionName is '__', since the request route, controller and action name are null. So the comparison fails and the observer returns early without applying the links.

if (!in_array($this->request->getFullActionName(), $this->_getAvailableActions())) {
    return true;
}

protected function _getAvailableActions()
{
    return array('cms_page_view');
}

Solution: if the area code by Magento\Framework\App\State::getAreaCode() is 'graphql' do not compare the action names.

@t-heuser
Copy link

t-heuser commented Dec 8, 2021

@mageworx @vitaliddd @sergei-sss
Anything on this issue?

@asysmageworx
Copy link

Hello @oneserv-heuser ,

Sorry for this delay. The task is already in our dev queue and I believe we'll release the update soon.

@asysmageworx
Copy link

Hello @oneserv-heuser @MarianNapi

after additional research we discovered that the problem is related to the base SEO extension.
We've already fixed the issue, however it will take a while to release the update.

As for now, please update the extension to the newest version and replace the following file with the file attached:
app/code/MageWorx/Model/Observer/AddCrosslinksToPageObserver.php

AddCrosslinksToPageObserver.php.zip

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

No branches or pull requests

3 participants