PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Extensions Support and Information ::  Modules ::  EzComments Upgrade error

Moderated by: Support Team

Goto page : 1 | 2 Next Page
Bottom
EzComments Upgrade error

  • Link to this postingPosted: 28.06.2006, 00:45
    Profile
    JonPurpleHaze
    rank:
    pnFreshman pnFreshman
    registered:
     March 2003
    Status:
    offline
    last visit:
    02.07.06
    Posts:
    17
    I've been trying to upgrade the EZComments module from .02 to 1.3 RC2 on PostNuke 0.7.6.2, after i regenerate the modules and hit Upgrade I receive the following error message:

    QuoteTable update failed: Duplicate column name 'anonname'


    I checked the nuke_ezcomments table and only see 1 anonname field in the structure.
  • Link to this postingPosted: 28.06.2006, 08:13
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    EZComments 0.2 didn't have an anonname field so not sure how that got there. Either you've got a previously attempted failed upgrade or possibly you've added some own fields for your own use.

    Anyway restore the EZComments table back to is v0.2 state from your database backup and re-run the upgrade procedure.

    -Mark
  • Link to this postingPosted: 28.06.2006, 20:51
    Profile
    JonPurpleHaze
    rank:
    pnFreshman pnFreshman
    registered:
     March 2003
    Status:
    offline
    last visit:
    02.07.06
    Posts:
    17
    ThankYou Mark,

    After reading your response, i remembered that i had a failed upgrade (see below error message) of EZComments last month and have been using .02 files with the 1.3 DB.

    I was able to upgrade but my site doesn't work after i enable EZComments in pnFlashGames (version 1.5), the following error message appears below my center block (no left or right blocks):
    QuoteError! Called unknown function: EZComments_adminapi_countitems()
    modname => pnFlashGames
    objectid => contid-1
  • Link to this postingPosted: 28.06.2006, 21:38
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    Something is calling an incorrect API - countitems is a user API not an admin one. As to what I don't know - only you know what's installed on your site. It could be pnflashgames or any of the blocks you have active.

    -Mark
  • Link to this postingPosted: 28.06.2006, 22:56
    Profile
    JonPurpleHaze
    rank:
    pnFreshman pnFreshman
    registered:
     March 2003
    Status:
    offline
    last visit:
    02.07.06
    Posts:
    17
    Sorry, I'm not very good at understanding this, wondering if there is a way i can troubleshoot this error..

    I found this post at pnflashgames.com but i'm not certain if it relates to my errors, wondering if it makes any sense.

    http://www.pnfl...ssionID=4166

    QuoteDon't know if your users are like mine but here they post quite a lot of comments in the games (in fact pnFlashGames is the only website module where users post regulary comments icon_lol )
    So I missed pagination in EZ-Comments and I modified it to add a pnRender Pager (well more exactly a Smarty pager, EZ-Commenst is templated). You need to modify 3 files (pnuserapi.php pnuser.php and the default.htm template) But beware, you need a RECENT pnuserapi.php (I took mine from CVS) because the mod need the EZComments_userapi_count function and this function isn't in the released version.
    To know details of the mod Go here
    If it bother you to edit the file, I can provide complete EZ-Comments from CVS with Leason modifs and mine and as an added bonus the ability to change # of comments per page in the module administration


    Jon



    edited by: JonPurpleHaze, Jun 28, 2006 - 11:03 PM
  • Link to this postingPosted: 28.06.2006, 23:11
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    Sorry but I can't really help that much. It seems like pnFlashgames or some related code is talking directly to the EZComments module which is really has no need to do - all a module needs is one line in the code pnModCallHooks. As a quick work-around - until you work out the root cause - you could re-implement the API that's being called.
    Open pnadminapi.php and add the following code at the end of the file (just before the closing PHP tag)
    Code
    function ezcomments_adminapi_countitems($args)
    {
        return pnModAPIFunc('EZComments', 'user', 'count', $args);
    }

    This code creates the missing API simply passing the information to the correct location. I'd raise this issue with Lee (pnFlashGames's author) since there's something not quite right here.
    -Mark
  • Link to this postingPosted: 29.06.2006, 01:26
    Profile
    JonPurpleHaze
    rank:
    pnFreshman pnFreshman
    registered:
     March 2003
    Status:
    offline
    last visit:
    02.07.06
    Posts:
    17
    Thanks again Mark,

    I'll go ahead and post about the problem @ PnFlashGames.com, the only time i receive errors now is if i update the EzComment Files from .02 to 1.3.

    I added your code on the EZComments pnadminapi.php file and was able to activate EZComments on pnFlashGames so i made it a step further! Now when i click on a game category i receive the error message listed below but the pnFlashGames home page and individual Game links work fine.
    QuoteError! Called unknown function: EZComments_userapi_count()
    modname => pnFlashGames
    objectid => 16

    Jon
  • Link to this postingPosted: 29.06.2006, 08:16
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    Sorry typo on my part - take a look at the code I posted and it should be obvious... 'count' vs 'countitems' in the user API call.

    -Mark
  • Link to this postingPosted: 30.06.2006, 03:43
    Profile
    JonPurpleHaze
    rank:
    pnFreshman pnFreshman
    registered:
     March 2003
    Status:
    offline
    last visit:
    02.07.06
    Posts:
    17
    Thanks Again,
    I added the following to the EZComments pnadminapi.php file and it fixed the Game category problems as described above!

    Code
    function ezcomments_adminapi_countitems($args)
    {
        return pnModAPIFunc('EZComments', 'user', 'countitems', $args);
    }

    Everything seems to work with pnFlashGames except all of the games have the same number of comments listed, ie:137 Comments.

    I discoverd another problem with my EZComments upgrade, sitewide, the bbcode (version:1.20) and smilies (version:1.16) below the EZComments input box are gone. icon_confused

    If it helps, none of these errors appear when i use .02's files with 1.3 RC2's DB.

    Jon



    edited by: JonPurpleHaze, Jun 30, 2006 - 03:58 AM
  • Link to this postingPosted: 30.06.2006, 08:18
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    An EZComments upgade won't affect other non EZComments related section of the site.

    The comment count logic has changed in this EZComments relase - again it sounds like pnflashgames is using some custom code to get the comment. Please refer this one to the pnflashgames site.

    For bbcode etc. make sure your running the most recent releases of these and that the bbcode etc. hooks are enabled for the EZComments module. Earlier releases of EZComments incorrectly took the hooks settings from the top level module (e.g. pnFlashgames, News etc.) rather than EZComments itself.

    Lastly you really should be doing all of this on a test site - don't touch your live site until your happy the test upgrade has been successful.

    -Mark
  • Link to this postingPosted: 30.06.2006, 09:30
    Profile
    JonPurpleHaze
    rank:
    pnFreshman pnFreshman
    registered:
     March 2003
    Status:
    offline
    last visit:
    02.07.06
    Posts:
    17
    Thanks again Mark,
    It looks like pnflashgames.com is dead but i still don't understand why my smilies and bbcode disappears after upgrading EZComments...
    I mentioned my versions of these hooks and have them configured properly, they disappear the second i replace 0.2 files with the new ones?
  • Link to this postingPosted: 30.06.2006, 09:34
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    Double check the configuration. As I indicated a hooks handling bug was fixed in the newer version meaning a configuration that worked under .2 might not be correct for 1.3. Check that the bbcode and smilie hooks are activated for the EZComments module.

    Are you using your own custom templates? If so then there's been template changes between versions. Not all the standard templates sets show all interface elements either so check that which template set your using in the module configuration.

    Apart from that i'm out of ideas without being able to see the problem first hand.

    -Mark
  • Link to this postingPosted: 01.07.2006, 00:18
    Profile Homepage
    jmvedrine
    rank:
    pnProfessional pnProfessional
    registered:
     January 2004
    Status:
    offline
    last visit:
    10.05.08
    Posts:
    628
    Hello,
    The problem is that pnFlashGames is trying to display the number of comments for each game.
    The right way to do that would be to use a pnRender plugin (as Pagesetter is doing it) but unfortunately pnFlashGames is not templated wich is a very sad thing icon_frown
    Even worst the code pnFlashgames uses to call the EZComments API is very outdated and doesn't work anymore with the current EZComments release.
    So the best thing to do is to fix pnFlashGames to use the correct call !
    Edit modules/pnFlashGames/pnuser.php and change:
    Code
    if ($ezcomments && pnModAPILoad('EZComments', 'admin')) {
            $numComments = pnModAPIFunc('EZComments',
                                        'admin',
                                        'countitems',
                                        array('modname' => 'pnFlashGames',
                                              'objectid' => $item['id']));

    to:
    Code
    if ($ezcomments) {
            $numComments = pnModAPIFunc('EZComments',
                                        'user',
                                        'countitems',
                                        array('mod' => 'pnFlashGames',
                                              'objectid' => $item['id'],
                                              'status' => 0));

    You will have to do the same change in 2 different places of the same file.
    Doing that you don't need to modify the EZComments module.
    -----
    Visit my live reef aquarium.

    My Amazon wish list.
  • Link to this postingPosted: 01.07.2006, 04:02
    Profile
    JonPurpleHaze
    rank:
    pnFreshman pnFreshman
    registered:
     March 2003
    Status:
    offline
    last visit:
    02.07.06
    Posts:
    17
    You guys are awesome, All of my problems are gone! icon_cool
    I switched templates from the AllOnOne template to the pnForum one and my bbcode and smilies reappeared.

    Per jmvedrine's instructions, I uploaded the original EZComments pnadminapi.php file after making the changes to the modules/pnFlashGames/pnuser.php file.
    QuoteYou will have to do the same change in 2 different places of the same file.

    In case anyone else runs into these problems, The second instance was replaced with:
    Code
    if ($ezcomments) {
            $numComments = pnModAPIFunc('EZComments',
                                        'user',
                                        'countitems',
                                       array('mod' => 'pnFlashGames',
                             'objectid' => 'contid-'.$contest['contid'],
                                           'status' => 0));


    I kept receiving some errors until i realized that i needed to do the same thing with a pnFlashGames Contest Block, i edited the contests.php file in modules/pnFlashGames/pnblocks.
    The correct # of comments are now showing up properly, Thank You!
    Jon






    edited by: JonPurpleHaze, Jul 01, 2006 - 04:14 AM
  • Link to this postingPosted: 01.07.2006, 08:45
    Profile Homepage
    markwest
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    24.04.08
    Posts:
    7647
    Cool - we got to the bottom of it in the end. Thanks to JM for taking a look at pnFlashgames.

    With regard to the template sets and things like bbcode not being in all of theme - this is by design. If all of the template sets looked the same then there would be no point having the different designs... Don't forget you can also design your own look and feel to the commenting pages too - for example our comments pages here at postnuke.com.

    -Mark
Goto page : 1 | 2 Next Page

Start ::  Extensions Support and Information ::  Modules ::  EzComments Upgrade error

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke