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

[Webservices] Do not deliver inherited values #3411

Closed
fashxp opened this issue Oct 2, 2018 · 14 comments
Closed

[Webservices] Do not deliver inherited values #3411

fashxp opened this issue Oct 2, 2018 · 14 comments
Assignees
Labels
Milestone

Comments

@fashxp
Copy link
Member

fashxp commented Oct 2, 2018

currently it delivers inherited values except of classification store.

@dpfaffenbauer
Copy link
Contributor

wouldn't it be better to somehow configure that with a param or so? just disabling inheritance could cause issues now for some people

@fashxp
Copy link
Member Author

fashxp commented Oct 2, 2018

can we find out how long it has been wrong?

@dpfaffenbauer
Copy link
Contributor

I guess thats difficult to do. Guess the best way is to test it with a existing Pimcore 4 installation.

I just checked the RestController in Pimcore 4 and there is no disabling of inheritance there.

@fashxp
Copy link
Member Author

fashxp commented Oct 2, 2018

in pimcore 4 inherited values were definitely not delivered

@weisswurstkanone
Copy link
Contributor

mhm ... PimcoreContextListener ($context would be "webservice" in our case) ... explicitly enables it

protected function initializeContext($context)
{
    if ($context == PimcoreContextResolver::CONTEXT_ADMIN) {
        \Pimcore::setAdminMode();
        Document::setHideUnpublished(false);
        DataObject\AbstractObject::setHideUnpublished(false);
        DataObject\AbstractObject::setGetInheritedValues(false);
        DataObject\Localizedfield::setGetFallbackValues(false);
    } else {
        \Pimcore::unsetAdminMode();
        Document::setHideUnpublished(true);
        DataObject\AbstractObject::setHideUnpublished(true);
        **DataObject\AbstractObject::setGetInheritedValues(true);**
        DataObject\Localizedfield::setGetFallbackValues(true);
    }
}

@weisswurstkanone
Copy link
Contributor

IMO, behavior should be the same as for CONTEXT_ADMIN

@fashxp fashxp reopened this Oct 2, 2018
@markus-moser
Copy link
Contributor

related to #175

@dpfaffenbauer
Copy link
Contributor

what speaks against a query parameter to enable/disable inheritance?

@fashxp
Copy link
Member Author

fashxp commented Oct 3, 2018

I think it is the only option, since the behavior is since pimcore 5 to include inherited values.
that's the reason why I reopened the issue, we need to discuss that internally.

@fashxp
Copy link
Member Author

fashxp commented Oct 3, 2018

Proposed Solution:

@dpfaffenbauer
Copy link
Contributor

  • Add Tests to test both behaviours ;)

@fashxp
Copy link
Member Author

fashxp commented Oct 3, 2018

  • Add Tests to test both behaviours ;)

pullrequests are as always welcome ;-)

@dpfaffenbauer
Copy link
Contributor

and this now also works for classification stores? Which was the actual source of this problem.

PR: Well, tests should be included in the actual implementation ;)

@weisswurstkanone
Copy link
Contributor

see #3269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants