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

[2.0.3] Theme settings remove error #3857

Closed
Kaik opened this Issue Nov 18, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@Kaik
Copy link
Contributor

Kaik commented Nov 18, 2017

Q A
Zikula Version 2.0.3
PHP Version 7.x

Expected behavior

No error

Actual behavior

Expected entity string is given "1col" type error when trying to delete the theme.

https://github.com/zikula/core/blob/master/src/system/ThemeModule/Controller/ThemeController.php#L225

Looks like those vars are strings, not objects when variable api is used like this

               $vars = $this->get('zikula_extensions_module.api.variable')->getAll($themeName);
                foreach ($vars as $var) {
                    $this->getDoctrine()->getManager()->remove($var);
                }

Steps to reproduce

Attempt to remove a theme.

I will make a PR and will change it to this?

   $this->get('zikula_extensions_module.api.variable')->delAll($themeName);
@craigh

This comment has been minimized.

Copy link
Member

craigh commented Nov 18, 2017

you have not described the actual behavior, you have simply pointed out the location of some code. What is the problem behavior? what is the error?

@Kaik

This comment has been minimized.

Copy link
Contributor

Kaik commented Nov 18, 2017

issue updated with actual behaviour

@Guite

This comment has been minimized.

Copy link
Member

Guite commented Dec 11, 2017

Expected entity string is given "1col" type error

Can you please elaborate? Please post the complete error message, ideally including a stack trace.

@Kaik

This comment has been minimized.

Copy link
Contributor

Kaik commented Dec 13, 2017

Can you please elaborate? Please post the complete error message, ideally including a stack trace.
@Guite I will do that (stack trace etc..) but at the moment I'm working on a completely different thing.

Stack trace pointed the line between foreach loop in below part of the code and it was saying that doctrine remove expected entity in $var but "1col" - "string" was given.

               $vars = $this->get('zikula_extensions_module.api.variable')->getAll($themeName);
                foreach ($vars as $var) {
                    $this->getDoctrine()->getManager()->remove($var);
                }

I'm sorry for not being exact I considered above code self explanatory:
$vars = $this->get('zikula_extensions_module.api.variable')->getAll('Module or Theme name'); retrives all module/theme vars as array of ['name' => 'value'] and then code is trying to delete them using doctrine but these are not doctrine objects https://github.com/zikula/core/blob/master/src/system/ExtensionsModule/Api/VariableApi.php#L99

I will find time to replicate this error if this is not clear enuff, hopefully soon.

Guite added a commit that referenced this issue Dec 13, 2017

@Guite Guite added this to the 1.5.4 milestone Dec 13, 2017

@Guite Guite added Bug and removed Feedback required labels Dec 13, 2017

@Guite Guite closed this Dec 13, 2017

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