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

Logger::addLog does not log from from the front office #11229

Closed
firstred opened this Issue Nov 1, 2018 · 7 comments

Comments

4 participants
@firstred
Contributor

firstred commented Nov 1, 2018

Describe the bug
When you call Logger::addLog from the front office, it will not log anything. This worked on 1.6 and in the back office.

To Reproduce
Grab some module that hooks to the front office. Add Logger::addLog('message'); to the code and notice how it won't land in the database.

Screenshots
N/A

Additional information
PrestaShop version: 1.7.5, likely more affected
PHP version: 7.1

@firstred

This comment has been minimized.

Contributor

firstred commented Nov 1, 2018

The bug seems to be in the AdminLogs controller. It does not list every single log entry. I wonder why...

@firstred

This comment has been minimized.

Contributor

firstred commented Nov 1, 2018

screenshot from 2018-11-01 23-00-06

Huge gap in the listing. Yuuuuuge.

@firstred

This comment has been minimized.

Contributor

firstred commented Nov 1, 2018

It should not do an INNER JOIN on id_employee, but a LEFT JOIN instead.

@khouloudbelguith

This comment has been minimized.

Contributor

khouloudbelguith commented Nov 2, 2018

Hi @firstred,

Do you have a module calling the Logger::addLog from the front office? It will allow us to do the regression tests.
Thanks!

@firstred

This comment has been minimized.

Contributor

firstred commented Nov 2, 2018

Here's a module you could try. It logs automatically from the front office and for the back office you should visit its configuration page.
testlog.zip

Notice how it lands in the database:
screenshot from 2018-11-02 10-38-03
but it is not visible on the logs page:
screenshot from 2018-11-02 10-39-22

@khouloudbelguith

This comment has been minimized.

Contributor

khouloudbelguith commented Nov 2, 2018

@firstred, thanks for your report.
In the 1.7.4.3, it is OK.
image
But in the 1.7.5.0, it is NOK, I manage to reproduce the issue.
In the DB, I have:
image
But in the logs page, the Logger::addLog does not log from the front office.
image
Would you be willing to make a pull request on GitHub with your code suggestion?
https://github.com/PrestaShop/PrestaShop/tree/develop
Thank you!

@firstred

This comment has been minimized.

Contributor

firstred commented Nov 2, 2018

Hi @khouloudbelguith

Sorry, I don't have enough time to figure out how this page has been migrated to Symfony, so I am not able to update the query to make it work.

Maybe @mickaelandrieu can chime in on this one?

@marionf marionf added To Do and removed TBR labels Nov 2, 2018

@marionf marionf removed their assignment Nov 2, 2018

@marionf marionf added this to To do in PrestaShop 1.7.5 via automation Nov 2, 2018

@marionf marionf added this to the 1.7.5.0 milestone Nov 2, 2018

@jolelievre jolelievre self-assigned this Nov 7, 2018

@jolelievre jolelievre moved this from To do to In progress in PrestaShop 1.7.5 Nov 7, 2018

@jolelievre jolelievre moved this from In progress to To be reviewed in PrestaShop 1.7.5 Nov 9, 2018

@jolelievre jolelievre moved this from To be reviewed to To be tested in PrestaShop 1.7.5 Nov 9, 2018

@marionf marionf moved this from To be tested to To be merged in PrestaShop 1.7.5 Nov 12, 2018

@jolelievre jolelievre moved this from To be merged to Done in PrestaShop 1.7.5 Nov 12, 2018

@marionf marionf added the Fixed label Nov 12, 2018

@marionf marionf removed the To Do label Nov 12, 2018

@marionf marionf closed this Nov 12, 2018

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