We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13730
    • 149 Posts
    MODx : 2.4.3
    PHP : 5.5.32
    MySql : 5.6.29
    Core : out of the web server's document root

    getResources : 1.6.1
    Collections : 3.4.1
    Tagger : 1.7.0
    phpThumbOf : 1.4.0
    EasyCopyright : 1.2


    Hi,

    I am currently developing a website and everything was working normally with getResources. Tonight I installed EasyCopyright and after doing some testing, I found that every place I used getResources, getResources was not working.

    I tried getResources on other resources, no result at all.

    I mention you the installation of EasyCopyright, because that's when I found that getResource stopped working.

    But I really do not see why the installation of EasyCopyright, prevent getResources to run.

    I have uninstalled EasyCopyright, emtpy the cache and run the «Setup 2.4.3», getResources still not working.

    My two calls of getResources

    [[!getPage? &elementClass=`modSnippet` &element=`getResources`&where=`[[!TaggerGetResourcesWhere? &groups=`2`]]` &tpl=`recetteListe-tpl`  &limit=`8` &sortdir=`ASC` &sortby=`pagetitle` &processTVs=`1` &includeTVs=`1`]]


       [[!getPage? &elementClass=`modSnippet` &element=`getResources` &parents=`7`  &limit=`4` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &tpl=`temoinTpl` &showUnpublished=`1` ]] 


    MODx errors log : empty

    Very strange situation.

    Thank for your help [ed. note: jber last edited this post 10 years, 6 months ago.]
      • 13730
      • 149 Posts
      Hi,

      After a night of sleep, I checked if getResource was installed :

      1) I checked if getResource was in the Extension Manager and indicate installed. YES, install date 2015-12-27

      2) I checked if getResources was in the Snippets tree, NO he was not there.

      3) I checked the list of actions to see if I had deleted it by mistake, NO action had been done on getResources

      4) I checked with phpMyAdmin if getResources was in mod_site_snippet table, NO it was not in the table

      5) I re-installed getResources from the Extension manager, et voilà! getResources working normally.

      So I re-installed EasyCopyright 1.2 and surprise getResources was deleted, zapped, gone.

      Definitely there is a conflict between EasyCopyright and getResources

      Thank
        • 3749
        • 24,544 Posts
        I looked at the EasyCopyright code and there's definitely nothing in the original code that could delete a snippet. It doesn't even connect to the database in any way.

        [Update] I think I know what may be happening. If the package has PRESERVE_KEYS set to true for the update, it may replace whatever snippet has the ID it's given. I'd have to see the transport file to be sure, and for some reason, it's not in the GitHub repo.
        [ed. note: BobRay last edited this post 10 years, 6 months ago.]
          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
          • 13730
          • 149 Posts
          Hi Bob,

          I would not want to mislead you, I just re-install EasyCopy and getResource was delete again.

          However I have note that EasyCopyright replaces getResource during installation. Before installing EasyCopyright, the id of getResources was 38 and now it is EasyCopyright who have the id 38.

          In the Extension manager the version of EasyCopyright is 1.2 but in the code below it is 1.1.1

          Thank for your support

          <?php
          /*
          #EasyCopyright#
          
          ##About##
          
          
          * By Cameron Gilroy
          * EasyCopyright
          * Version: 1.1.1
          * Based in part on Copyright by AMDbuilder
          * Creator: Cameron Gilroy http://www.camerongilroy.com
          * Support URL: http://www.camerongilroy.com/
          * GitHub: http://github.com/camgill/EasyCopyright
          
          EasyCopyright is a simple snippet for ModX Revolution that inserts the the current year and the site name. Check the example below.
          
          *© +CameronGilroy.com+ 2009-2011 - Powered by +MODx+*
          
          ###Thanks###
          
          A big thank you goes to the creators of MODx Revolution!  
          [dflock](https://github.com/dflock/ "dflock"): Thanks for the new features added to 1.1!
          
          ###Usage###
          
          <code>[[!EasyCopyright]]</code> - Outputs *© [[Your Site name here]] 2011 - Powered by MODx*  
          <code>[[!EasyCopyright? &StartYear=`2009`]]</code> - Outputs *© [[Your Site name here]] 2009-2011 - Powered by MODx*
          
          
          ##Configuration##
          
          The variables that are available are listed below with a description.
          You can also call the contents of a chunk into any of these fields like this <code>[[!EasyCopyright? &Powered=`[[$Your_Chunk_Name]]`]]</code>
          
          * Name - Your site name
          * Start Year - What ever you put in!
          * YearSeparator - is the separator that goes between the Start Year and the current year
          * PoweredBy - if this is "false" the "Powered by MODx" will not show
          * Powered - is the link to the ModX site
          * PoweredBySeparator - is the separator that goes between the current Year and Powered by
          
          ###Defaults###
          
          * Name - Your site name
          * Start Year - No Default must be called in the snippet
          * Powered - is the link to the ModX site
          * YearSeparator - "-"
          * PoweredBySeparator - "-"
          * PoweredBy - "true"
          */
          
          $Name = isset($Name)? $Name : $modx->getOption('name',$scriptProperties,'[[++site_name]]');
          
          $PoweredBySeparator = isset($PoweredBySeparator)? $PoweredBySeparator : "-";
          $Powered = isset($Powered)? $Powered : "Powered by <a href='http://www.modxcms.com'>MODx</a>";
          
          if ($PoweredBy != 'false') {
          
          	$PoweredBy = " ".$PoweredBySeparator." ".$Powered;
          
          } else {
          	$PoweredBy = "";
          }
          
          $YearSeparator = isset($YearSeparator)? $YearSeparator : "-";
          $cYear = date("Y");
          $StartYear = isset($StartYear)? $StartYear : $cYear;
          $years = ($cYear > $StartYear) ? $StartYear.$YearSeparator.$cYear : $cYear;
          
          return "© $Name $years$PoweredBy";
          
          
            • 3749
            • 24,544 Posts
            You can install getResources and then create the EasyCopyright snippet manually in the manager and paste in the code above.

            Before doing that, I'd go into PhpMyAdmin and repair all tables in the DB. The autoincrement value could be off for the modx_snippets table.

            If you feel like experimenting, you could create a new snippet and see if saving it deletes the most recently created snippet. If so, *any* snippet you install will wipe out the previous snippet.
              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
              • 13730
              • 149 Posts
              Hi,

              While you answer me, I reinstall EasyCopyright and its got the id 2. The problem, i did not notice which snippet have the id 2 before installing EasyCopyright.

              So remove completely EasyCopyright first via the Extension Manager but that did not work. I delete the snippet manualy.

              I re-install getResources I see it in Snippets tree, but getResources is not working. I delete the Cache, repair the tables with PhpMyAdmin, getResources still not working.

              I remove completely getResources via the Extensions Manager. I dowload again getResources via the Extensions Manager install it, no chance still not working.
                • 3749
                • 24,544 Posts
                Is there anything helpful in the MODX error log?
                  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
                  • 13730
                  • 149 Posts
                  Hi,

                  Sorry I can give you this information because I install a backup of the database.

                  In this backup EasyCopyright was install.

                  I remove it and re-install getResources.

                  getResources is working now.

                  The first time I install easyCopyright I take a screen shot of the console, see the attachment.

                  For now I would not use EasyCopyright.

                  I would have liked to know the cause of the problem.

                  In your experience, do you think that future installation of extras may cause a similar problem?

                  Thank very much for your help
                    • 3749
                    • 24,544 Posts
                    If you've repaired the tables in the DB, I don't think you'll have trouble, but I don't recommend installing EasyCopyright in PackageManager again -- just paste the code in a snippet. wink
                      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
                      • 13730
                      • 149 Posts
                      I have repaired the tables in the DB, after installing my backup.

                      Thank for your help.