We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8643
    • 271 Posts
    Quote from: grabenfub at Aug 05, 2009, 06:21 PM

    On another note I’m using maxigallery backend manager with managermanager. When I add the widget:

    mm_widget_mg_backend_manager('4','Gallery','','8');


    I get a popup with this error when editing a document:

    ManagerManager: An error has occurred: TypeError - $("iframe") is null


    Although the gallery works after I OK it and move on. If I remove the widget the error doesn’t appear. I’ve looked around in the forum for this issue to no avail. Any ideas?
    In assets/plugins/managermanager/widgets/mg_backend_manager/mg_backend_manager.php change:
    $('iframe').load(function()
    to
    \$j('iframe').load(function()

      • 25483
      • 741 Posts
      Quote from: elastic at Aug 07, 2009, 05:10 AM

      Quote from: grabenfub at Aug 05, 2009, 06:21 PM

      On another note I’m using maxigallery backend manager with managermanager. When I add the widget:

      mm_widget_mg_backend_manager('4','Gallery','','8');


      I get a popup with this error when editing a document:

      ManagerManager: An error has occurred: TypeError - $("iframe") is null


      Although the gallery works after I OK it and move on. If I remove the widget the error doesn’t appear. I’ve looked around in the forum for this issue to no avail. Any ideas?
      In assets/plugins/managermanager/widgets/mg_backend_manager/mg_backend_manager.php change:
      $('iframe').load(function()
      to
      \$j('iframe').load(function()

      or use attached file

      There is still a problem; when you click on "If the tab is empty, please, click here to Save and Refresh" it opens a new window with the site in it. So it doesn’t refresh the page!
        with regards,

        Ronald Lokers
        'Front-end developer' @ h2o Media

        • 19975
        • 429 Posts
        I’m getting the following message when trying to create a new Resource:

        ManagerManager: an error has occurred:
        TypeErro - Cannot call method ’val’ of null

        I’m able to edit existing items fine
          Martin Sanders - Design & Web Development
          • 11186
          • 38 Posts
          Thanks elastic. Although I have the same problem as mediaguy after the changes. However, I right clicked on the page and hit reload and the galleries show in their tab after that and in each subsequent document I edit that has galleries. But it only lasts for the login session.

          The change you suggested did manage to fix the scrolling bug so I could turn scrolling back to the default ’no’ again in mg_backend_manager.php

          I’m guessing I should probably take this to the maxigallery backend manager thread from here.

          Thanks again.

          Also after hitting edit/cancel a couple of times on a document with a gallery, the galleries show.

          I changed this in assets/plugins/managermanager/widgets/mg_backend_manager/mg_backend_manager.php

          saveRefreshPreview();


          to this

          document.mutate.save.click();


          It saves and closes to get the galleries to show up in the created tab. The goal is to have it save and keep editing, but I’m sure someone better suited could improve upon this.

          EDIT - Scratch the above. I found Dimmy’s post here. http://modxcms.com/forums/index.php/topic,29875.msg210416.html#msg210416
            • 8643
            • 271 Posts
            mm_widget_showimagetvs();
            now must work wink

            Download fixed version from the first post.


            p.s. mm_changeFieldHelp - is not working, anybody can fix it?
              • 25483
              • 741 Posts
              Quote from: elastic at Aug 09, 2009, 08:38 AM

              p.s. mm_changeFieldHelp - is not working, anybody can fix it?

              I think that it’s changed because they now use a jquery popup thingy instead of a javascript alert.
                with regards,

                Ronald Lokers
                'Front-end developer' @ h2o Media

                • 25483
                • 741 Posts
                If I use the "mm_widget_tags" widget it doesn’t show the tags, but it does show the pages from the cms instead. Does somebody know why that happens?
                  with regards,

                  Ronald Lokers
                  'Front-end developer' @ h2o Media

                  • 19
                  • 10 Posts
                  Just had a quick play with the latest version of ManagerManager for Evo on Evo 1.0 Final and have had some trouble with mm_requireFields. Initially, ManagerManager threw a Type Error because $("mutateContent") was null -- in MODx Evo 1.0, this form has been changed from
                  <form name="mutate" id="mutateContent" method="post" enctype="multipart/form-data" action="index.php">
                  

                  to
                  <form name="mutate" id="mutate" class="content" method="post" enctype="multipart/form-data" action="index.php">
                  

                  which explains the Type Error. However, changing the reference to this form id in functions/requirefields.inc.php unfortunately wasn’t enough to fix the problem -- now ManagerManager stops throwing an error, but it draws a large white box over the top of the page and doesn’t force any specified fields to be required. This calls for a bit more investigation, I think!
                    • 8643
                    • 271 Posts
                    Quote from: /Robin at Aug 14, 2009, 12:28 PM

                    Just had a quick play with the latest version of ManagerManager for Evo on Evo 1.0 Final and have had some trouble with mm_requireFields.
                    Try this smiley
                    <?php
                    
                    /*
                    
                    	added by Jelle Jager AKA TobyL - Make fields required
                    
                    	Probably could do with some cleanup. Made in a hurry :)
                    
                    	@version: 0.2 - added TVs handling.
                    
                    */
                    
                    
                    
                    function mm_requireFields($fields, $roles='', $templates=''){
                    
                    	global $mm_fields, $modx;
                    
                    	$e = &$modx->Event;
                    
                    
                    
                    	// if we've been supplied with a string, convert it into an array
                    
                    	$fields = makeArray($fields);
                    
                    
                    
                    	// if the current page is being edited by someone in the list of roles, and uses a template in the list of templates
                    
                    	if (useThisRule($roles, $templates)) {
                    
                    
                    
                    		$output = " // ----------- Require field -------------- \n";
                    
                    		$output .= '$j("#mutate").bind("submit", function(){ var count=0; var msg = "";'."\n";
                    
                    
                    
                    		//$output .= '$j("input[name=menuindex]")';
                    
                    		foreach ($fields as $field) {
                    
                    			//ignore for now
                    
                    			switch ($field) {
                    
                    
                    
                    				// fields for which this doesn't make sense - in my opinion anyway :)
                    
                    				case 'keywords':
                    
                    				case 'metatags':
                    
                    				case 'hidemenu':
                    
                    				case 'which_editor':
                    
                    				case 'template':
                    
                    				case 'menuindex':
                    
                    				case 'show_in_menu':
                    
                    				case 'parent':
                    
                    				case 'is_folder':
                    
                    				case 'is_richtext':
                    
                    				case 'log':
                    
                    				case 'searchable':
                    
                    				case 'cacheable':
                    
                    				case 'clear_cache':
                    
                    				case 'content_type':
                    
                    				case 'content_dispo':
                    
                    				case 'which_editor':
                    
                    					$output .='';
                    
                    				break;
                    
                    
                    				// Ones that follow the regular pattern
                    
                    				default:
                    
                    				// What type is this field?
                    
                    				if (substr($field, 0, 2) == 'tv') {
                    
                    					$output .= 'if($j("#'.$field.'").val()==""){ count++; var clr = $j("#'.$field.'").css("background-color"); $j("#'.$field.'").css({"background-image":"none","background-color":"#ff9999"}).bind("focus", function(){$j(this).css("background-color",clr);});}'."\n";
                    
                    					//$output .= '$("#'.$field.'").parents("tr").hide(); ';
                    
                    				} elseif (isset($mm_fields[$field])) {
                    
                    					$fieldtype = $mm_fields[$field]['fieldtype'];
                    
                    					$fieldname = $mm_fields[$field]['fieldname'];
                    
                    					$output .= 'if($j("'.$fieldtype.'[name='.$fieldname.']").val()==""){ count++; var clr = $j("'.$fieldtype.'[name='.$fieldname.']").css("background-color"); $j("'.$fieldtype.'[name='.$fieldname.']").css({"background-image":"none","background-color":"#ff9999"}).bind("focus", function(){$j(this).css("background-color",clr);}); }'."\n";
                    
                    				} else {
                    
                    					break;
                    
                    				}
                    
                    				break;
                    
                    			}
                    
                    		}
                    
                    		$output .= 'if(count>0){ alert( count + " required fields are missing!\n\n Please correct the indicated fields." ); return false; }else{ return true; } });'."\n";
                    
                    		$e->output($output . "\n");
                    
                    	} // end if
                    
                    } // end function
                    
                    
                    
                    
                    
                    ?>

                      • 19
                      • 10 Posts
                      Quote from: elastic at Aug 15, 2009, 08:12 PM

                      Quote from: /Robin at Aug 14, 2009, 12:28 PM

                      Just had a quick play with the latest version of ManagerManager for Evo on Evo 1.0 Final and have had some trouble with mm_requireFields.
                      Try this smiley

                      Thanks a lot, that works nicely. It’s a shame TVs have to be defined by ID rather than by name, as the site I’m working on has a huge number of TVs and it is somewhat of a pain to have to look up their IDs every time I need to edit the MM rules.