HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Enabled or not ? (and! categories problem)

This discussion is related to the Tagging Enhanced addon.
PamelaPamela ✭✭
edited January 2011 in Vanilla 2.0 - 2.8
Hi,

Thanks for this advanced version but when I click on "Enabled" (at your "Tagging" page, not "Plugins" page) then this "Bonk" page is displayed !

Note: after back (using browser button) and refresh... I can see my tags (and so your plugin is enabled...)

Categories are broken (this "Bonk" appears again...) using “Pretty” URL's or not

My server config... Linux, Apache 1.3, PHP 5.2, MySQL 5.0 with Vanilla 2.1.6

Pleasen how could I fix this ?
Tagged:

Comments

  • Hi Pamela,

    Some questions to help me debug your error.

    1. Did you disable and remove the old tagging plugin before adding this plugin?
    2. Did you enable categories before adding this plugin?

    If the answer is yes to the above:

    1. Can you go to your config.php in the CONF directory, and switch on your error pages (for debugging) to the following:
    $Configuration['Garden']['Errors']['MasterView'] = 'deverror.master.php';

    This should spit out the real error messages instead of having "BONK" page.

    After doign this, please paste what you see and I will look through it.

    Thanks!
  • PamelaPamela ✭✭
    edited January 2011
    Thank you for your quick reply...
    1. Did you disable and remove the old tagging plugin before adding this plugin?
    yes ;-) of course
    2. Did you enable categories before adding this plugin?
    yes! before using your plugin ;-) but I don't remember if I'd enabled Categories or Tags plugin by Mark
    1. Can you go to your config.php in the CONF directory, and switch on your error pages (for debugging) to the following:
    $Configuration['Garden']['Errors']['MasterView'] = 'deverror.master.php';
    Ok! so, I see this lines (when I click on a category link)

    Fatal Error in Gdn_Database.Query(); Table 'xxx.GDN_TagCategoryCount' doesn't exist select t.Name as `Name`, tcc.CountDiscussions as `CountDiscussions` from GDN_Tag t join GDN_TagCategoryCount tcc on t.TagID = tcc.TagID where tcc.CountDiscussions > :tccCountDiscussions and tcc.CategoryID = :tccCategoryID order by tcc.CountDiscussions desc limit 25 The error occurred on or near: /home/xxx/library/database/class.database.php 225: 226: if (!is_object($PDOStatement)) { 227: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR); 228: } else if ($PDOStatement->execute($InputParameters) === FALSE) { 229: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR); 230: } 231: } else { 232: $PDOStatement = $this->Connection()->query($Sql); 233: } Backtrace:

    (...)

    Do you need more info ?
  • It seems that the tagcategorycount table doesn't exist. It should have been created when you click "enable tagging" after installing the plugin.

    I suspect your database login / password doesn't allow you to create / drop tables?

    This should probably explains why the script "hangs" when you try to "enable" tagging....

    Have you checked that the database login / password you are using with vanilla has full create / drop table rights?
  • PamelaPamela ✭✭
    edited January 2011
    It seems that the tagcategorycount table doesn't exist. It should have been created when you click "enable tagging" after installing the plugin.
    Yes, when I click on "Enable tagging" (after installing the plugin) I see (now... via debugging mode) this error:

    Fatal Error in Gdn_Database.Query(); Table 'xxx.GDN_discussion' doesn't exist update GDN_tagdiscussion tagdiscussion inner join GDN_discussion discussion on tagdiscussion.DiscussionID = discussion.DiscussionID set tagdiscussion.CategoryID = discussion.CategoryID

    and !
    The error occurred on or near: /home/xxx/library/database/class.database.php
    232: $PDOStatement = $this->Connection()->query($Sql);
    233: }
    234:
    235: if ($PDOStatement === FALSE) {
    236: trigger_error(ErrorMessage($this->GetPDOErrorMessage($this->Connection()->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
    237: }
    238:
    239: $ReturnType = GetValue('ReturnType', $Options);
    240:
    (...)

    and ;-) in phpMyAdmin I can see these tables, so it seems there is a probleme between uppercase and lowercase:

    * GDN_Tag (23)
    * GDN_tagcategorycount (0)
    * GDN_tagdiscussion (0)
    * GDN_TagDiscussion (123)
    I suspect your database login / password doesn't allow you to create / drop tables?

    This should probably explains why the script "hangs" when you try to "enable" tagging....

    Have you checked that the database login / password you are using with vanilla has full create / drop table rights?
    Yes, my used login and password user has full table privileges ;-) dixit cPanel
  • ah I think I know the bug. mysql on windows is case insensitive but is case sensitive on Linux.

    I did not realize this as my development environment is windows...

    since you are running on Linux hence the error!

    let me update the code with proper casing for the SQL statements and I think it shd be ok...
  • pamela i have uploaded a revised version. please check it out.

    1. Disable old tagging enhanced plugin
    2. Remove old tagging enhanced plugin
    3. Copy in new tagging enhanced plugin
    4. Enable plugin
    5. Enable Tagging

    Let me know if this works :)

    thx...
  • PamelaPamela ✭✭
    edited January 2011
    Ok ;-) thank you for this update but (for me) at step 5 there is an error...
    Fatal Error in Gdn_Database.Query();

    Can't DROP 'CategoryID'; check that column/key exists

    alter table `GDN_TagDiscussion` drop column `CategoryID`

    The error occurred on or near: /home/xxx/library/database/class.database.php

    232: $PDOStatement = $this->Connection()->query($Sql);
    233: }
    234:
    235: if ($PDOStatement === FALSE) {
    236: trigger_error(ErrorMessage($this->GetPDOErrorMessage($this->Connection()->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
    237: }
    238:
    239: $ReturnType = GetValue('ReturnType', $Options);
    240:
    and if I click on a category link:
    Fatal Error in Gdn_Database.Query();

    Table 'xxx.GDN_TagCategoryCount' doesn't exist

    select t.Name as `Name`, tcc.CountDiscussions as `CountDiscussions`
    from GDN_Tag t
    join GDN_TagCategoryCount tcc on t.TagID = tcc.TagID
    where tcc.CountDiscussions > :tccCountDiscussions
    and tcc.CategoryID = :tccCategoryID
    order by tcc.CountDiscussions desc
    limit 25

    The error occurred on or near: /home/xxx/library/database/class.database.php

    225:
    226: if (!is_object($PDOStatement)) {
    227: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
    228: } else if ($PDOStatement->execute($InputParameters) === FALSE) {
    229: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
    230: }
    231: } else {
    232: $PDOStatement = $this->Connection()->query($Sql);
    233: }
  • sorry I forgot to mention,
    after you disable and remove the old plugin, can you
    1. delete the tagcategorycount table
    2. remove the categoryID column in the tagdiscussion table
    after you do this add back the new plugin and re enable the tagging...

    you need to do this because the old tables from the old version are still in the system...
  • PamelaPamela ✭✭
    edited January 2011
    Yes, it's close to be fixed now... but please, could you confirm me these actions
    sorry I forgot to mention,
    after you disable and remove the old plugin, can you
    1. delete the tagcategorycount table
    2. remove the categoryID column in the tagdiscussion table
    after you do this add back the new plugin and re enable the tagging...

    you need to do this because the old tables from the old version are still in the system...
    1. Ok, I delete the tagcategorycount table and ;-) I delete this tagdiscussion table too, isn't ?

    2. Ok, I remove the categoryID column but in the TagDiscussion table ;-) of course ?

  • 1. Yes, delete the tagcategorycount table... but No! Don't delete tagdiscussion table!
    2. Yes, remove categoryID column, ONLY in the tagdiscussion table (which you do not delete!)

    :)
  • 1. Yes, delete the tagcategorycount table... but No! Don't delete tagdiscussion table!
    2. Yes, remove categoryID column, ONLY in the tagdiscussion table (which you do not delete!)

    :)
    First thanks again fort your support ;-) but I didn't wait your reply...

    So, I'd deleted this tagdiscussion table and! removed categoryID column in the TagDiscussion :-( then, it was not worked! of course

    May be it's too late to try to repair it and a best way will be to erase all these tables and re-install these 2 plugins
  • Pamela:
    Its ok... actualy, the cleanest way is to just
    1. reinstall vanilla
    2. remove old tagging plugin
    3. install new tagging plugin

    If you do not have any data in your forum, you can do the above, it will be the best :)
  • Pamela:
    Its ok... actualy, the cleanest way is to just
    1. reinstall vanilla
    2. remove old tagging plugin
    3. install new tagging plugin

    If you do not have any data in your forum, you can do the above, it will be the best :)
    Yes, I'm so stupid ;-)) I didn't wait your latest advices and! now, it's the better way (for us)

    Many thanks for all your help ;-)) and happy new year 2011
Sign In or Register to comment.