{"action":"created","issue":{"url":"https://api.github.com/repos/thirtybees/thirtybees/issues/393","repository_url":"https://api.github.com/repos/thirtybees/thirtybees","labels_url":"https://api.github.com/repos/thirtybees/thirtybees/issues/393/labels{/name}","comments_url":"https://api.github.com/repos/thirtybees/thirtybees/issues/393/comments","events_url":"https://api.github.com/repos/thirtybees/thirtybees/issues/393/events","html_url":"https://github.com/thirtybees/thirtybees/issues/393","id":272874786,"number":393,"title":"Lots of undefined offsets","user":{"login":"Traumflug","id":318581,"avatar_url":"https://avatars0.githubusercontent.com/u/318581?v=4","gravatar_id":"","url":"https://api.github.com/users/Traumflug","html_url":"https://github.com/Traumflug","followers_url":"https://api.github.com/users/Traumflug/followers","following_url":"https://api.github.com/users/Traumflug/following{/other_user}","gists_url":"https://api.github.com/users/Traumflug/gists{/gist_id}","starred_url":"https://api.github.com/users/Traumflug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Traumflug/subscriptions","organizations_url":"https://api.github.com/users/Traumflug/orgs","repos_url":"https://api.github.com/users/Traumflug/repos","events_url":"https://api.github.com/users/Traumflug/events{/privacy}","received_events_url":"https://api.github.com/users/Traumflug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-11-10T09:44:18Z","updated_at":"2017-11-16T21:55:33Z","closed_at":null,"author_association":"COLLABORATOR","body":"Noticed by @30knees https://forum.thirtybees.com/topic/1061/error-notice-undefined-offset-113. Developer installation, almost no custom modules. Simply going to Backoffice -> Administration -> Permissions results in a lot of error messages like this:\r\n\r\n```none\r\nNotice on line 366 in file /var/www/html/ThirtyBees/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code\r\n[8] Undefined offset: 101\r\n\r\nNotice on line 372 in file /var/www/html/ThirtyBees/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code\r\n[8] Undefined offset: 101\r\n\r\nNotice on line 373 in file /var/www/html/ThirtyBees/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code\r\n[8] Undefined offset: 101\r\n\r\nNotice on line 380 in file /var/www/html/ThirtyBees/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code\r\n[8] Undefined offset: 101\r\n[...]\r\n```"},"comment":{"url":"https://api.github.com/repos/thirtybees/thirtybees/issues/comments/345075311","html_url":"https://github.com/thirtybees/thirtybees/issues/393#issuecomment-345075311","issue_url":"https://api.github.com/repos/thirtybees/thirtybees/issues/393","id":345075311,"user":{"login":"Traumflug","id":318581,"avatar_url":"https://avatars0.githubusercontent.com/u/318581?v=4","gravatar_id":"","url":"https://api.github.com/users/Traumflug","html_url":"https://github.com/Traumflug","followers_url":"https://api.github.com/users/Traumflug/followers","following_url":"https://api.github.com/users/Traumflug/following{/other_user}","gists_url":"https://api.github.com/users/Traumflug/gists{/gist_id}","starred_url":"https://api.github.com/users/Traumflug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Traumflug/subscriptions","organizations_url":"https://api.github.com/users/Traumflug/orgs","repos_url":"https://api.github.com/users/Traumflug/repos","events_url":"https://api.github.com/users/Traumflug/events{/privacy}","received_events_url":"https://api.github.com/users/Traumflug/received_events","type":"User","site_admin":false},"created_at":"2017-11-16T21:55:33Z","updated_at":"2017-11-16T21:55:33Z","author_association":"COLLABORATOR","body":"Yikes!\r\n\r\nFinally found something looking like a bug: https://github.com/thirtybees/thirtybees/commit/35a478a86d06e29fb367e68129ad842b8af9339d\r\n\r\nAll the previous findings were more like \"Oh, PrestaShop forgot a whole chunk of code\" ... which is not entirely impossible, but also not likely.\r\n\r\nNew story goes as following: installing a module also installs access/permission flags in DB table `tb_access`. However, previous code did so not for all existing profiles, but only for the last existing one. Slight array code messup :-) Obvious outcome of this previous code: missing access flags in the database. Which is exactly what this long list of error messages essentially means.\r\n\r\nThis also explains why bisecting didn't work: reading code is entirely fine. It's database writing code which was faulty, resulting in an incomplete database.\r\n\r\nFor fixing the database, resetting (or an uninstall/install cycle) of the module with the new code is sufficient.\r\n\r\nBut which module?\r\n- As far as I can see, only modules installing a backoffice menu entry (\"Tab\") are affected.\r\n- `101` in the list of error messages (see opening post) is the modules' tab ID. \r\n- Then one can run this `SELECT * FROM tb_tab WHERE id_tab = 101;`, e.g. in phpMyAdmin. This will map the tab ID to a name.\r\n\r\nWill move this new code to branch *1.0.x* tomorrow unless there are objections."}}
{"actor":{"display_login":"Traumflug"}}