We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30319
    • 406 Posts
    Very embarassing experience.
    Set up a list of files to be retrieved via FileLister 1.1.1-pl and then I get told they don't work, they somehow cause the logged-in user to go to the LOGOUT page.
    I tested and found ones that do this, then hit the Back button and clicked the link again and it worked properly.
    WHY did/does this happen??
    HOW do I ensure it doesn't happen again??
    I went in (as admin, I think) and clicked all the links and RE-clicked the ones that did not work on first try -- how do I know this won't happen again and have to re-click again etc.??
    PLEASE someone clarify this to me...is it a browser cache issue (doubt it because I never touched the site before with the browser I'm now using)?? is it a MODx cache issue?? is this a user-specific problem that will vary by different users??
    Thank you, Tom

    Description of Problem:

    Steps to Reproduce:
    visit secure site, requires login, users have permissions to media source
    Expected Outcome:
    link should open, not go to unauthorized/logout page

    • MODX Version: 2.2.4
    • PHP Version: 5.3.6
    • Database (MySQL) Version: 5.1.65
    • Additional Server Info:
    • Installed MODX Add-ons: FileLister, this is the only one that's having the problem
    • Error Log Contents: (attach as file if it’s too large)
    Sample errors that might explain things:
    [2013-01-10 11:57:01] (ERROR @ /index.php) feoDownload: Attempt to set NOT NULL field referer to NULL
    [2013-01-10 15:30:20] (ERROR @ /index.php) feoDownload: Attempt to set NOT NULL field referer to NULL
    [2013-01-10 15:30:20] (ERROR @ /index.php) feoDownload: Attempt to set NOT NULL field referer to NULL
    [2013-01-10 15:30:20] (ERROR @ /index.php) feoDownload: Attempt to set NOT NULL field referer to NULL
    [2013-01-10 15:30:21] (ERROR @ /index.php) feoDownload: Attempt to set NOT NULL field referer to NULL
    I recognize the FEO string as something to do with FileLister...??

    Thank you, Tom [ed. note: TomMLS last edited this post 13 years, 8 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Does it only do this the first time a new link is clicked, or the first time any user clicks on any link?

      Developers, any time you specify a NOT NULL field, you must give it a default value. Otherwise there are any number of situations and "corner cases" where an attempt may be made to save a row with that particular field empty, thus triggering that error.

      The filelister_downloads table has all of its fields set as NOT NULL, but has six fields with no default value! To prevent these errors, you can go into the database and modify the table to give 0 or '' empty string values to these. In phpMyAdmin you can use the "none" option in the drop-down.
      As is not uncommon, I have no idea what I'm talking about! [ed. note: sottwell last edited this post 13 years, 8 months ago.]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Well now that's very interesting. Looking at the schema, all the fields do in fact have default values listed. But in the database table, most of them had no default value at all.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ok, it has nothing to do with the assignment of default or no default. If a field is assigned NOT NULL, MySQL will throw an exception if an attempt to save with no value in a field is used. So the burden falls to the form processing script to make sure that all fields passed to the database for saving has something in it. Definitely not something I would have expected; I would think a default value means that's what gets inserted if there is no value provided. http://forums.mysql.com/read.php?20,246740,247051#msg-247051
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 30319
            • 406 Posts
            Quote from: sottwell at Jan 10, 2013, 11:06 PM
            Does it only do this the first time a new link is clicked, or the first time any user clicks on any link?
            !

            I did not know I would have to re-click (i.e. hit back button to return to the page with the list of files after being sent to logout page, then click link again to have it work) until I clicked something.

            fileLister did assign values/links to each file, but why did they not work??

            I'll test again when I return to work.

            Thank you, Tom [ed. note: TomMLS last edited this post 13 years, 8 months ago.]
              • 30319
              • 406 Posts
              I *was* able to reproduce the problem.
              I logged in with a Chrome incognito window (means browser cache is clear) with a different account than I used before, and started testing FileLister links.
              Soon after, one of the links sent me to the Logout page (LOGIN addon is used with a user group to protect access to this site, PM me about this), then I used the Back button, then clicked the link again, then the link worked properly.
              WHAT could be causing this?? Wasn't this addon tested??
              MODx developers and fanboys tend to forget that 90%+ of MODx users are NOT developers nor are they MODx fanboys, and that we MODx users expect things to work correctly, not require kludges like hitting the Back button and re-clicking a link to make it work...
              Looks like I must try the OTHER addon for auto-creating file lists and then find out how buggy THAT one is.
              WNEN is MODx ever gonna put quality control onto addons??
              Thank you, Tom
              P.S. Sorry for ranting but this bug created embarrassment for LOT of people.
              P.P.S. Again found this in the log but because the timestamp does not easily correlate with my East Coast clock time, I can't absolutely say this is related to the issue I have here, I only know that two files failed to load from FileLiater, different ones than failed to load last night, requiring usage of the Back button and re-clicking the link:
              [2013-01-11 05:42:15] (ERROR @ /index.php) feoDownload: Attempt to set NOT NULL field referer to NULL
              [ed. note: TomMLS last edited this post 13 years, 8 months ago.]
                • 9207 ☆ A M B ☆
                • 2,475 Posts
                I understand you're frustrated, but it doesn't help to blow up in the forums. Keep in mind that there are *always* issues with software. MODX does do more quality control than many projects when it comes to submissions: addons have to be approved and looked over. Compare this to the absolute craziness that ends up in say, the WordPress plugin repository. However, that in no way guarantees things will always work.

                I'd recommend that you file a bug in FileLister's bug tracker:
                https://github.com/splittingred/FileLister

                Maybe message splittingred and see if you might get some help.
                  • 3749
                  • 24,544 Posts
                  This may be an issue with Chrome. I often have to click twice on buttons in the Manager grids (especially in Package Manager) with Chrome.
                    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
                    • 30319
                    • 406 Posts
                    @BobRay: I will check if it's a Chrome issue or not...
                    Thank you, Tom