We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    When I use this rule in MM_rules: (to get on page Evogallery upload tab)
    mm_widget_evogallery('2','','','7');

    In Firefox IE there is no problem but in Chrome I get:

    ManagerManager: An error has occurred: TypeError - Cannot read property 'hasChildNodes' of undefined

    and all mm_rules stop working.

    Evo 1.0.14
    MM 0.6.1

    Actually I think I will update and see if it still happens on 0.6.2 and Evo 1.0.15

    This question has been answered by danilocuculic. See the first response.

    [ed. note: fourroses666 last edited this post 9 years, 2 months ago.]
      Evolution user, I like the back-end speed and simplicity smiley
    • discuss.answer
      • 36416
      • 589 Posts
      Quote from: fourroses666 at Feb 09, 2015, 02:27 PM
      When I use this rule in MM_rules: (to get on page Evogallery upload tab)
      mm_widget_evogallery('2','','','7');
      In Firefox IE there is no problem but in Chrome I get:
      ManagerManager: An error has occurred: TypeError - Cannot read property 'hasChildNodes' of undefined and all mm_rules stop working.

      It's a timing problem with JavaScript loading/execution (Chrome got insanely parallelized asset loader recently - just look at console log message "Synchronous XMLHttpRequest on the main thread is deprecated...").

      If upgrade ends being less than helpful, try this delayed approach:
      https://github.com/Eoler/ManagerManager/commit/6d0a833caabfca036d984c16cdccaa279a2f75ef
        • 9995
        • 1,613 Posts
        After update it works! thanks for your help Eoler.
        Don't know if your delayed approach works.
          Evolution user, I like the back-end speed and simplicity smiley
          • 9995
          • 1,613 Posts
          Hmm, the popup is still there, I didn't look with Chrome probably.

          So the update didn't fix it.

          Also when I look at my folders in the ManagerManager plugin I don't see the frametab folder.

          https://github.com/fourroses666/EvoGallery/blob/master/assets/plugins/managermanager/widgets/evogallery/evogallery.php


          <?php
          //---------------------------------------------------------------------------------
          // mm_widget_evogallery
          //---------------------------------------------------------------------------------
          function mm_widget_evogallery($moduleid, $title='', $roles='', $templates='') {
          global $modx, $content, $mm_fields;
          $e = &$modx->Event;
          if (useThisRule($roles, $templates)) {
          //Include language file
          $langpath = $modx->config['base_path'] . "assets/modules/evogallery/lang/";
          //First include english
          if (file_exists($langpath.'english.inc.php'))
          include $langpath.'english.inc.php' ;
          //Include current manager language
          if (file_exists($langpath.$modx->config['manager_language'].'.inc.php'))
          include $langpath.$modx->config['manager_language'].'.inc.php';
          $title = empty($title) ? $_lang['mm_tab_name'] : $title;
          //TODO: Add iframe autoheight
          if (isset($content['id']))
          $iframecontent = '<iframe id="mm_evogallery" src="'.$modx->config['site_url'].'manager/index.php?a=112&id='.$moduleid.'&onlygallery=1&action=view&content_id='.$content['id'].'" style="width:100%;height:600px;" scrolling="auto" frameborder="0"></iframe>';
          else
          $iframecontent = '<p class="warning">'.$_lang['mm_save_required'].'</p>';
          mm_createTab($title, 'evogallery', '', '', '<strong>'.$_lang['mm_manage_images'].'</strong>', '100%');
          $output = "\$j('#table-evogallery').append('<tr><td>$iframecontent</td></tr>');";
          } // end if
          $e->output($output . "\n"); // Send the output to the browser
          }
          ?>
          
            Evolution user, I like the back-end speed and simplicity smiley
            • 36416
            • 589 Posts
            Quote from: fourroses666 at Feb 12, 2015, 02:46 PM
            Also when I look at my folders in the ManagerManager plugin I don't see the frametab folder.
            (...)
            <!--?php
            $output = "\$j('#table-evogallery').append('$iframecontent');";
            

            Yeah, FramedTab is a custom widget... I'm not using EvoGallery (but loading MaxiGallery Manager in FramedTab, which is similar enough). You can try wrapping one line of code quoted above with setTimeout.
              • 9995
              • 1,613 Posts
              Quote from: danilocuculic at Feb 12, 2015, 08:54 PM
              You can try wrapping one line of code quoted above with setTimeout.

              What do you mean, I don't know how to set timeout. PHP is not my language :0
              Do I need to use FramedTab widget instead?
                Evolution user, I like the back-end speed and simplicity smiley
                • 36416
                • 589 Posts
                Quote from: fourroses666 at Feb 12, 2015, 10:25 PM
                What do you mean, I don't know how to set timeout. PHP is not my language :0
                Do I need to use FramedTab widget instead?

                Its JavaScript, actually (but delivered through PHP - how confusing is that? tongue )

                Can't you try the proper fix for your widget from GitHub?
                https://github.com/Mark-H/EvoGallery/issues/68
                I'm mentioning it because lazyloaded FramedTab widget isn't compatible with officialy distributed ManagerManager 0.6.x
                  • 9995
                  • 1,613 Posts
                  Looks like updating Evogallery worked. There is an other version I didn't know of.
                  Thanks for the pro tip.
                    Evolution user, I like the back-end speed and simplicity smiley