We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4971
    • 964 Posts
    Everything with ManagerManager is working fine except for the published by default when saved,
    I have set it to 1 but when the page is saved, it is not set to "published"

    Here is the code...  published is close to the bottom:

    <?php
    
    // MM rules can go in here, instead of a chunk
    // If you copy them to a chunk, don't include the opening and closing PHP tags
    
    // ------------------------ INSERT YOUR RULES HERE --------------------
    // These are example rules -- replace them with your own
    // PHP *is* allowed
    
    
    mm_widget_showimagetvs(); // Always give a preview of Image TVs
    
    // Role Variables -- creating a variable makes it easier to manage if this changes in the future
    $admin_role = '2';
    $editor_role = '3';
    $corrector_role = '4';
    
    // Sections
    mm_hideSections('access,content', '2,3,4'); // Hide the Access and Content sections for all users [mm_hideSections($sections, $roles, $templates)]
    mm_renameSection('docsettings', 'Datos Generales', '2,3,4', '5,6,7'); // Rename the document settings section for users with role "2,3,4" and template "5"
    mm_renameSection('tvs', 'Datos del Video', '2,3,4', '6'); // Rename TV section for role "2,3,4" and template "6" [mm_renameSection($section, $newlabel, $roles, $templates)]
    mm_renameSection('tvs', 'Datos del Avance', '2,3,4', '7'); // Rename TV section for role "2,3,4" and templete "7"
    
    // Tabs
    mm_hideTabs('settings,meta,preview', '2,3,4');  // Hide the meta and preview tabs for all users [mm_hideTabs($tabs, $roles, $templates)]
    mm_renameTab('general', 'Entrada de Datos'); // Rename the general tab for users with role "2" [mm_renameTab($tab, $newlabel, $roles, $templates)]
    
    // Fields
    mm_hideFields('tvheader,tvnavigation,tvsidebar,tvdittoCall,tvfooter,tvshowgrid', '2,3,4'); // mm_hideFields($fields, $roles, $templates)
    mm_hideFields('longtitle,alias,link_attributes,introtext,template,menutitle,menuindex,show_in_menu,parent', '2,3,4');
    mm_synch_fields('pagetitle,alias,longtitle', '2,3,4');
    
    
    // Defaults - For everyone
    // mm_default('pub_date'); // mm_default($field, $value, $roles, $templates, $eval)
    mm_default('published', '1', '2,3,4', '6,7');
    mm_default('cacheable', '0', '2,3,4', '6,7');
    mm_default('show_in_menu', '0', '2,3,4', '6,7');
    mm_default('is_folder', '0', '2,3,4', '6,7');
    
    
    // ------------------------ END OF RULES --------------------
    ?>


    What can be wrong?

    I commented out the mm_default(pub_date) because I thought it was
    interfering, but it does not work without it also.
      Website: www.mercologia.com
      MODX Revo Tutorials:  www.modxperience.com

      MODX Professional Partner
      • 4971
      • 964 Posts
      Nobody?

      So lets rephrase it...

      If I use the following statement in ManagerManager:

      mm_default('published', '1', '2,3,4', '6,7');


      Does it mean that the ’published’ field will be populated with a check when saving the document for roles 2,3,4 in templates 6 & 7?

      What would make it not behave like that?  Thanks...

      EDIT:

      This must be a bug that I, and 230 readers could figure out how to fix...
      I fix it by moving the field to the visible tab and having the client click to publish every time...
      not optimal, but it works!
        Website: www.mercologia.com
        MODX Revo Tutorials:  www.modxperience.com

        MODX Professional Partner
        • 4971
        • 964 Posts
        This must be a bug that I, and 230 readers could figure out how to fix...
        I fix it by moving the field to the visible tab and having the client click to publish every time...
        not optimal, but it works!
          Website: www.mercologia.com
          MODX Revo Tutorials:  www.modxperience.com

          MODX Professional Partner