We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    Forgive the elementary nature of this post I am a front-end developer, not a back-end guy. I know enough to troubleshoot minor issues, but nothing complicated.

    When using either of the 0.6.x versions of ManagerManger and the mm_galleryLink function I get an error that won't let me edit the page where it's being used.

    Here's the rule in my mm_rules chunk:
    mm_galleryLink('gal,slides', '1,2,3', '4,10', '3');

    I have a TV called 'gallery' that is supposed to create a 'Mange Photos" link at the bottom of every gallery page based on that ManagerManager rule. However, every time I tried to use it I got this error:
    Fatal error: Call to undefined function mm_galleryLink() in /home/website/public_html/assets/plugins/managermanager/mm.inc.php(178) : eval()'d code on line 17

    So, I tried to upgrade ManagerManager and in doing so I realized that the mm_gallerylink.php script was not longer included in that release. So, I went back and added it in to the new "widgets" folder (it has all the old functions from mm) in the same format and it started to work, but with some weirdness. I get all the &output spit out in the header of the form element on the edit page.

    $output .= 'var pid'.$mm_fields[$field]['fieldname'].' = "'.(!empty($content['id']) ? $content['id'] : 'false').'";'."\n";
                    	$output .= 'var gl'.$mm_fields[$field]['fieldname'].' = $j("'.$mm_fields[$field]['fieldtype'].'[name='.$mm_fields[$field]['fieldname'].']");'."\n";
                    	$output .= 'if(pid'.$mm_fields[$field]['fieldname'].' != \'false\'){'."\n";
                        $output .= '    var galleryLink = $j(\'<a href="' . $modx->config['base_url'] . 'manager/index.php?a=112&id='.$moduleid.'&action=view&content_id=\'+pid'.$mm_fields[$field]['fieldname'].'+\'">Manage Photos</a>\').insertAfter(gl'.$mm_fields[$field]['fieldname'].');'."\n";
                    	$output .= '} else {'."\n";
                        $output .= '    var galleryLink = $j(\'<p class="warning">You must save this page before you can manage the photos associated with it.</p>\').insertAfter(gl'.$mm_fields[$field]['fieldname'].');'."\n";
                    	$output .= '}'."\n";
    					$output .= 'gl'.$mm_fields[$field]['fieldname'].'.hide();'."\n";


    Even though this output from the mm_gallerylink.php file is shown the page functions just fine and the gallery link works. Any ideas on how to get this code not to show?
      The MODx has you...
      Utah Web Design