We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi guys,

    In my server error log I have lots of entries as below when a user completes my user registration login page:

    PHP Notice:  Undefined index: snippetNameHere in /core/components/login/model/login/loginhooks.class.php on line 137
    


    Code for the snippetNameHere is to upload a file from the registration page to Dropbox - i'd rather not post for fear of a security breach - any ideas what could be triggering this error in the snippet?

    I have code below included to save the name of the filename being uploaded - I am guessing it might be in these lines?

    $user = & $fields['register.user'];
    $userId = $user->get('id');
    $profile = & $fields['register.profile'];
    $extended = $profile->get('extended');
    $extended['extendedFieldName'] = $upload_filename;
    $profile->set('extended', $extended);
    $profile->save();
    


    Any ideas?

    Cheers,



    dubbs.
      • 3749
      • 24,544 Posts
      Every hook listed in the &hooks property has to be either a built-in hook, a file-based hook, or a snippet. The error message is telling you that you have something listed in the &hooks property that isn't any of those, most likely snippet that doesn't exist or whose name is misspelled (it could be case-sensitive).
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 8168
        • 1,118 Posts
        Quote from: BobRay at Nov 02, 2015, 05:47 PM
        Every hook listed in the &hooks property has to be either a built-in hook, a file-based hook, or a snippet. The error message is telling you that you have something listed in the &hooks property that isn't any of those, most likely snippet that doesn't exist or whose name is misspelled (it could be case-sensitive).

        OK thanks Bob. Odd thing is though... that it is not calling in any snippets that don't exist...

        The error specifies a snippet which exists and is being called correctly as the functionality in it is working... not sure what the error being reported therefore suggests?
          • 3749
          • 24,544 Posts
          Does the snippet have any properties? If not, try creating one and see if that has any effect.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 8168
            • 1,118 Posts
            No properties no - not sure how to use properties to be honest and don't want to do something which will make the snippet not work on this live site... so i'd rather not experiment tbh. No worries if the bug is not a problem... seems odd though!
              • 3749
              • 24,544 Posts
              Adding a property (on the Properties tab when editing the snippet) will have no effect on the operation of the snippet and could prevent the error message (or not), but it's your call.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting