We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14617
    • 47 Posts
    Great module!

    Has anyone tried to implement an export function? Exporting to CSV would be extremely useful for getting the data into excel.

    Jonas
    subvision.dk
      • 4264
      • 20 Posts
      Hi,

      For local developent I use MODX evo 1.0.4 on MAMP 1.9 for Mac.
      MAMP gives you two flavours: php 5.2 and 5.3.

      I get errors with this module using php 5.3.2.
      This php eror occurs:

      Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING in .../modx-1.0.4/manager/processors/execute_module.processor.php(114) : eval()'d code on line 1
      


      It seems like the php-code that’s inserted in the "module code (php)" textarea in the "general" tab is being escaped, but not unescaped when fetched from the database.


      I managed to get it to work in 5.3 by changing file [MODX]/manager/processors/execute_module.processor.php, line 114, from:
      $mod = eval($moduleCode);
      

      to
      $mod = eval(stripslashes(($moduleCode)));
      
      ,
      but this doesn’t seem like a robust solution (i’m not a php expert)

      Anyone any suggestions?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I edited my php.ini file to set magic_quotes_gpc = OFF and that solved the problem. Of course, I had to clean up the one or two elements I’d manually added before realizing that it was doing this.

        The php.ini file is in Applications/MAMP/conf/php5.3
          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
          • 4264
          • 20 Posts
          Hi Susan,
          Thanks for the tip!
          BTW (a bit off topic): this directive was not present in the php.ini file, so i added it manually.
          Still, I’m a bit confused: if this directive is not present, why would it be necessary to explicitly turn it off?
          See http://php.net/manual/en/migration53.deprecated.php

            • 4264
            • 20 Posts
            To prevent issues with the magic_quotes_gpc directive, I changed this line in execute.module.processor.php:
            $mod = eval(($moduleCode));
            

            into:
            $mod = get_magic_quotes_gpc() ? eval(($moduleCode)) : eval(stripslashes($$moduleCode));
            

            It tests first if the directive is set to On. If not, the stripslashes function is applied.
            This way, this module should work in both situations.
            I tested it on my local Mamp, with php 5.2 (magic_quotes_gpc = On) and php 5.3 (no directive present in php.ini). It fails when the directive is not present in the 5.3 php.ini file. When it is explicitly set to Off, it does work. I don’t quite understand this behavior.
              • 3749
              • 24,544 Posts
              Something like this may take care of the problem:

              if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
                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
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Quote from: bueno at Jun 18, 2010, 04:52 AM

                Still, I’m a bit confused: if this directive is not present, why would it be necessary to explicitly turn it off?
                See http://php.net/manual/en/migration53.deprecated.php
                Yeah, that puzzled me a bit too, but it seems to do the trick. Maybe it’s a bug, I really don’t know.
                  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
                  • 4264
                  • 20 Posts
                  Thanks Bob!
                  Quote from: BobRay at Jun 18, 2010, 12:17 PM

                  Something like this may take care of the problem:

                  if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {


                  I’ll try this and let you know soon.

                  EDIT:
                  Nope, you still need to set the magic_quotes_gpc() directive to Off explicitly in the php.ini.
                    • 9757
                    • 82 Posts
                    I’ve got problems with updating records in my table from dbEdit interface. I can add a new record without problems, but when I’m trying to change it - then I’ve got ’Record succesfully updated’ notice, but nothing changes.

                    The same thing happens when I’m using "Save and add another". The first record is saved, but another isn’t.

                    I’m using ncrossland version of dbEdit with cache clearing added by cipa.

                    MODx: 1.0.4
                    MySQL: 5.1.48
                    PHP: 5.2.12

                    Any suggestions?

                    EDIT:
                    OK. I found that my table ’Key Field’ was configured badly. But, this only helped for the first problem mentioned - now I can update my records but still "Save and add another" isn’t working sad
                      • 17460
                      • 14 Posts
                      Hi,
                      I just found this great module yesterday and installed it here under the latest evo release (1.0.4).
                      The module does a great job, but it’s interface is not really compatible with the current evo version of modx. There are some hardcoded theme paths to the "MODxGreen"-theme which is not available in a default evo installation. Furthermore the module uses some graphics from the "MODxCarbon"-Theme, which have been renamed. This all results in a still very usefull module - but it’s gui is buggy and incomplete.
                      In my installation I adjusted the hardcoded theme paths to dynamic ones, corrected the names of graphics which have changed, added missing graphics from older modx releases to my theme. So now the interface is fixed and complete. But it’s style differs a bit from newer moduls, because this module was developed for older modx releases.

                      Anyway my question is:
                      - is this module still under active development?
                      - could you please optimize the module for the current evo release?
                      - or should I upload my fixed version to this site?

                      Regards,
                      Reguel