Skip to content

Fix: BO - dashactivity - module can't be SAVED properly#48

Merged
Hlavtox merged 2 commits into
PrestaShop:devfrom
Codencode:fix-37033-module-can-t-be-SAVED-properly
Oct 1, 2024
Merged

Fix: BO - dashactivity - module can't be SAVED properly#48
Hlavtox merged 2 commits into
PrestaShop:devfrom
Codencode:fix-37033-module-can-t-be-SAVED-properly

Conversation

@Codencode
Copy link
Copy Markdown
Contributor

Added method "saveDashConfig"

Questions Answers
Description? The configuration should be saved
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#37033
How to test?

Added method "saveDashConfig"
@ps-jarvis
Copy link
Copy Markdown

Hello @Codencode!

This is your first pull request on dashactivity repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

Hlavtox
Hlavtox previously approved these changes Sep 27, 2024
@Hlavtox Hlavtox added this to the 2.1.2 milestone Sep 27, 2024
@florine2623
Copy link
Copy Markdown
Contributor

Thanks for the PR.
Some checks were not successful, could you check @Codencode ?

@Codencode
Copy link
Copy Markdown
Contributor Author

Codencode commented Oct 1, 2024

florine2623

Hi @florine2623,
I don’t think I can fix it because, from what I understand, in the definition of the ModuleCode::getPermission() method, the first parameter is defined as array, whereas it should be string.

PS 1.7.7.8

    /**
     * Check employee permission for module.
     *
     * @param array $variable (action)
     * @param Employee $employee
     *
     * @return bool if module can be transplanted on hook
     */
    public function getPermission($variable, $employee = null)
    {
        return Module::getPermissionStatic($this->id, $variable, $employee);
    }

https://github.com/PrestaShop/PrestaShop/blob/753bc2441bc21d79a366f3c7566a03da1ac915eb/classes/module/Module.php#L2768-L2779

PS 8.2.0

    /**
     * Check employee permission for module.
     *
     * @param string $variable (action)
     * @param Employee $employee
     *
     * @return bool if module can be transplanted on hook
     */
    public function getPermission($variable, $employee = null)
    {
        return Module::getPermissionStatic($this->id, $variable, $employee);
    }

https://github.com/PrestaShop/PrestaShop/blob/327c9e42b556fcd676ff02376c00d8d8c3521061/classes/module/Module.php#L2587-L2598

I believe we should simply ignore the warning.

@Hlavtox
Copy link
Copy Markdown
Contributor

Hlavtox commented Oct 1, 2024

@Codencode Yeah, just add this error here. :-)

https://github.com/PrestaShop/dashactivity/blob/dev/tests/phpstan/phpstan-1.7.7.neon

and here also, because in 1.7.8 it's still an array in the docs and it will also scream at you

https://github.com/PrestaShop/dashactivity/blob/dev/tests/phpstan/phpstan-1.7.8.neon

@Codencode
Copy link
Copy Markdown
Contributor Author

@Codencode Yeah, just add this error here. :-)

https://github.com/PrestaShop/dashactivity/blob/dev/tests/phpstan/phpstan-1.7.7.neon

and here also, because in 1.7.8 it's still an array in the docs and it will also scream at you

https://github.com/PrestaShop/dashactivity/blob/dev/tests/phpstan/phpstan-1.7.8.neon

@Hlavtox,
I hope I did well, I added the errors to the files in my repository and uploaded them.
I never added "ignoreErrors"

Thanks!

@Hlavtox
Copy link
Copy Markdown
Contributor

Hlavtox commented Oct 1, 2024

@Codencode Good job, all good now! :-)

@Hlavtox
Copy link
Copy Markdown
Contributor

Hlavtox commented Oct 1, 2024

@florine2623 Ready to go! :-)

@Codencode
Copy link
Copy Markdown
Contributor Author

@Codencode Good job, all good now! :-)

@Hlavtox Thank you!

@florine2623 florine2623 self-assigned this Oct 1, 2024
Copy link
Copy Markdown
Contributor

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Codencode ,

Thanks for the PR !

Wrks as expected as you can see :

Screen.Recording.2024-10-01.at.14.25.55.mov

It is QA ✅

@florine2623 florine2623 added QA ✔️ Status: Check done, Code approved and removed waiting for QA labels Oct 1, 2024
@Hlavtox Hlavtox merged commit 8695fb3 into PrestaShop:dev Oct 1, 2024
@Hlavtox
Copy link
Copy Markdown
Contributor

Hlavtox commented Oct 1, 2024

Thanks everyone!

@Codencode Codencode deleted the fix-37033-module-can-t-be-SAVED-properly branch February 19, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA ✔️ Status: Check done, Code approved

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

BO - dashactivity - module can't be SAVED properly

4 participants