Fork me on GitHub

Hooks problem - this has to be a bug(?)  Bottom

  • I'm happy to report this in Cozi if it's not already known and if I'm not doing something wrong...

    I am implementing OpenID on a new site, I've already done it once elsewhere. I did exactly the same steps, everything seems to work except the OpenID isn't being saved. I finally traced it to includes\pnMod.php, line 1123 (v1.1.1):

    Code

    $extrainfo = pnModAPIFunc($modulehook['tmodule'], $modulehook['ttype'], $modulehook['tfunc'],
                                                      array('objectid' => $hookid,
                                                            'extrainfo' => $extrainfo));


    When the loop to call hooks starts, the value of $extrainfo is an array containing the name of the module, in this case Users. However the above line of code seems to be intended to alter the value of $extrainfo. In my case, the first hooks called are for Intercom, and at least one of those hooks returns "true", so that value of $extrainfo is now "true", and no longer is an array containing the name of the module. When the OpenID hook is called, it checks to see of the name of the module in $extrainfo is Users, and if not returns true and doesn't create the OpenID record. This was not a problem in my other installation because OpenID was the first hook created and Intercom's return value didn't set it. In this installation, it started working once I "unhooked" Intercom from Users.

    1) I would guess that at minimum this is a bug in Intercom, returning a value that messes with other hooks.
    2) Possibly its a bug in OpenID, depending on a certain value to be passed in $extrainfo that might not be there by the time the hook is actually called
    3) Seems to be a poor design in pnMod in which return values from one hook can hose execution of another hook.

    Comments?

This list is based on users active over the last 60 minutes.