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

Extensions are not updated inside the preview #675

Closed
Olivier127 opened this issue Apr 28, 2024 · 0 comments · Fixed by #676
Closed

Extensions are not updated inside the preview #675

Olivier127 opened this issue Apr 28, 2024 · 0 comments · Fixed by #676

Comments

@Olivier127
Copy link
Contributor

Q A
Bug? yes
New Feature? no
SuluArticleBundle Version 2.5.3
Sulu Version 2.5.15

Actual Behavior

Identical to the #7348 of sulu

Expected Behavior

The extensions must be refresh

Steps to Reproduce

Identical to the #7348 of sulu

Possible Solutions

Change this code inside ArticleObjectProvider

    public function setValues($object, $locale, array $data)
    {
        $propertyAccess = PropertyAccess::createPropertyAccessorBuilder()
            ->enableMagicCall()
            ->getPropertyAccessor();

        $structure = $object->getStructure();
        foreach ($data as $property => $value) {
            try {
                $propertyAccess->setValue($structure, $property, $value);
            } catch (\InvalidArgumentException $e) {
                // @ignoreException
                //ignore not existing properties
            }
        }
    }

to this code

    public function setValues($object, $locale, array $data)
    {
        $propertyAccess = PropertyAccess::createPropertyAccessorBuilder()
            ->enableMagicCall()
            ->getPropertyAccessor();

        $structure = $object->getStructure();
        foreach ($data as $property => $value) {
            try {
                if ('ext' === $property) {
                    $object->setExtensionsData(new ExtensionContainer($value));
                    continue;
                }

                $propertyAccess->setValue($structure, $property, $value);
            } catch (\InvalidArgumentException $e) {
                //ignore not existing properties
            }
        }
    }
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 a pull request may close this issue.

1 participant