We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21778
    • 223 Posts
    Using Manager i suddenly have an unbearable loading time when editing resources that are using a Multilingual template. it takes 22 seconds from when i press "Edit Resource" to the actual "Edit Resource page" is displayed =(

    I can’t recall these loading times when i started messing around with YAMS, so im a bit confused! laugh

    Anyone else experienced anything like this?

    EDIT:

    Damn it has something to do with yams.mm_rules.inc.php
    i added some custom lines (custom TV’s), and it seems to be them that are causing the problems.
      • 21778
      • 223 Posts
      In yams.mm_rules.inc.php i tryed to add 7 custom TV’s to make them appear on top in my language tabs.

      I replaced line 139:

      $tvString .= implode( ’,’, $customTVs );

      With:

      $tvString .= ’Product_Picture_’ . $langId . ’,’ . $tvString;
      $tvString .= ’Product_Thumbnail_’ . $langId . ’,’ . $tvString;
      $tvString .= ’Product_Description_’ . $langId . ’,’ . $tvString;
      $tvString .= ’Product_’ . $langId . ’,’ . $tvString;
      $tvString .= ’Brand_’ . $langId . ’,’ . $tvString;
      $tvString .= ’Varenummer_’ . $langId . ’,’ . $tvString;
      $tvString .= ’Nyhed_’ . $langId . ’,’ . $tvString;


      This works as intended, but causes the long load times. huh
        • 22851
        • 805 Posts
        Hmm. In terms of string operations, that’s certainly not the most efficient way of adding the custom tvs to the beginning of the list: Each line probably requires copying the string to a new place in memory - but I find it hard to believe that would be the cause of slow page loads. Are you sure that you don’t get slow page loads when you use the original mm_rules code (in other words, with the custom multilingual tvs appearing after the standard ones)?

        How about replacing the block where $tvString is constructed with this:
              // Convert to list...
              $tvString = '';
              if ( $nCustomTVs > 0 )
              {
                $tvString .= implode( ',', $customTVs );
              }
              if ( $nStandardTVs > 0 )
              {
                if ( $nCustomTVs > 0 )
                {
                  $tvString .= ',';
                }
                $tvString .= implode( ',', $standardTVs );
              }
        


        It’s equivalent to the existing code, but puts the custom TVs in front of the standard TVs.
          YAMS: Yet Another Multilingual Solution for MODx
          YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
          Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.