We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11798
    • 43 Posts
    Hello there,

    I ran an Easy2Gallery on MODX Evolution 1.0.15. Now, that I upgraded to Evo 1.1. the plugin is not working anymore. Reinstallation was unsuccessful too.
    (Some messages are displayed at the atttached image.)
    It seems the db connection method has been changed and I get a lot connection errors and warnings.

    Is there any workaround to fix this? Thanks in advance.

    Greetings,
    Hardoman

    Edit:
    Probably this reason? From: https://modx.com/blog/2016/02/29/modx-evolution-1.1%E2%80%94dozens-of-improvements-and-over-300-commits/

    Important changes to note:

    Deprecated Mysql replaced with Mysqli, to ensure compatibility with PHP 5.6 +
    [ed. note: Hardoman last edited this post 8 years ago.]
      • 13226
      • 953 Posts
      The codebase for E2G hasn't changed in years, and yes, you're right - it uses the old MYSQL extension

      There are three ways to go - one not good, the others not easy:

      1) change your config.inc.php from "mysqli" to "mysql" - this will break at some point when your server no-longer supports the mysql extension

      2) recode E2G to use the latest PHP version(s)

      3) recode E2G to use the DBAPI

      I am not a PHP coder, so I can't help with 2 or 3

      You may also like to look at GitHub, as you aren't the first to post ref E2G not working in 1.1
        • 11798
        • 43 Posts
        Hello Iusemodx,

        thanks for your reply and the hint, to read the github issues. For now, I will probably try to go with version 1 and have to keep in mind, that the platform might be in trouble later.

        Regards,
        Hardoman
          • 11798
          • 43 Posts
          Update: Unfortunately, there is no difference if I change $database_type to "mysql" in config.inc.php.
            • 15001
            • 697 Posts
            Yes, there are issues with MODx 1.1 and upper.

            I was using Easy2 Gallery with MODx 1.0.14 or 1.0.15.

            Hardoman, when telling about an issue with some component, it would be useful to mention the version of the module/plugin/snippet (as well as the version of PHP).

            With MODx 1.1 or MODx 1.2, one issue with Easy2 Gallery 1.4.0 Beta 4 seem coming from PHP functions being no longer supported.
            For instance, in assets/modules/easy2/includes/classes/e2g.snippet.class.php, at line 1278, the "mysql_query()" command fails :
                  $res = mysql_query($q);
                    if (!$res) {
                        return; // asuming there are multiple gids
                    }
                    if ($option === 'alias') {
                        while ($l = mysql_fetch_array($res)) {


            Replacing by $modx->db->query() works.

            The same with mysql_fetch_array(), a.s.o.

            With the latest version of Easy2 Gallery (1.4.14), downloaded from https://modx.com/extras/package/easy2gallery, another error message arise:
            Table 'YourDatabaseName.modx_easy2_configs' doesn't exist

            I cannot see any "install" folder in the archive where to pick the SQL statements to create that table.
            I assume it contains the key value pairs that were previously in file "config.easy2gallery.php".


            Edit: There is an installer at "/assets/modules/easy2/install/", but is outdated. [ed. note: Jul last edited this post 7 years, 4 months ago.]