Getting error on 2.3
Am getting this error when I enable the plugin Prefix Discussion:
|Gdn_Database|Query|show tables like 'GDN_Permission'
Any chance to fix it?
0
Am getting this error when I enable the plugin Prefix Discussion:
|Gdn_Database|Query|show tables like 'GDN_Permission'
Any chance to fix it?
Comments
PrefixDiscussion even works in 2.4b1
That snippet you are showing is quite small. Could you show more information of the error message?
The addon could not be enabled because it generated a fatal error:
|Gdn_Database|Query|show tables like 'GDN_Permission'@R_J
You can fix that by replacing the permissions in the array with these changes
'RegisterPermissions' => array( 'Garden.Moderation.Manage', 'Garden.Settings.Manage', 'Vanilla.Discussion.Add', 'Vanilla.Discussion.View' ),Then here
public function settingsController_prefixDiscussion_create($sender) { $sender->permission(array('Garden.Moderation.Manage','Garden.Settings.Manage'));Then here
public function postController_beforeBodyInput_handler($sender) { // Only show dropdown if permission is set. if (!checkPermission('Vanilla.Discussion.Add')) { return; }And here
public function discussionController_beforeDiscussionRender_handler($sender) { if (!checkPermission('Vanilla.Discussion.View')) { return; }Then here too
public function base_beforeDiscussionName_handler($sender, $args) { if (!checkPermission('Vanilla.Discussion.View')) { return; }After that it works for me..
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Thanks for the feedback! I've started investigating this and it is working if you try to enable it a second time, nothing else is needed.
I see where the error is, but not why that should be an error...
$fixDone = c('PrefixDiscussion.PrefixMixingFixDone', false); if (!$fixDone) { Gdn::sql()->update('Discussion', array('Prefix' => null), array('Prefix' => '')); saveToConfig('PrefixDiscussion.PrefixMixingFixDone', true); }The update generates that error, but the config value is saved. The next time the plugin is enabled the config value check results in skipping the update statement and that's why the plugin activation is working on the second try.
Thank! @R_J and @vrijvlinder
@lalala Please
If you never used prefixDiscussion before and this was the first time that you have tested it, you could stay with the old version. If you are interested, you could take a look at the changed lines and you will see that there only has been a substantial change in the setup process.