We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3611
    • 19 Posts
    I have a chunk like this which is only shown to authenticated users, to allow them to logout.


    Hi, [[+modx.user.username]] <a href="[[+logoutUrl]]">Sign out</a> 
    
    [[!Login? &tplType=`embedded` &errTplType=`embedded`]]



    However, I find that the +logoutUrl placeholder is never written.

    I believe that there is an error in the bottom of the Login snippet:

    switch ($tplType) {
        case 'embedded':
            if (!$authenticated) $modx->setPlaceholders($phs); /* THIS STOPS IT WORKING! */
            /* $modx->setPlaceholders($phs);             THIS ALTERNATIVE SEEMS TO WORK! */
            break;
        case 'modChunk':
            $output .= $modx->getChunk($tpl, $phs);
            break;
        case 'file':
            $output .= file_get_contents($tpl);
            $modx->setPlaceholders($phs);
            break;
        case 'inline':
        default:
            /* default is inline, meaning the tpl content was provided directly in the property */
            $output .= $tpl;
            $modx->setPlaceholders($phs);
            break;
    }
    
    return $output;
    ?>
    


    Does that seem like a likely bug and fix, or have I once again misunderstood how the whole shooting match works? wink

      • 28215
      • 4,149 Posts
      Try putting the snippet call before the placeholder reference.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 3611
        • 19 Posts
        Already tried it ’Red, no diff. Being no stranger to incompetence, I’ve just tried it again to confirm.
          • 28215
          • 4,149 Posts
          Hm. I’d file a bug here then:

          http://github.com/splittingred/Login/issues/
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 3611
            • 19 Posts
            Will do, ta.
              • 28215
              • 4,149 Posts
              Try Login 1.0.3-rc1.
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 3611
                • 19 Posts
                That works nicely. Many thanks.
                  • 31724
                  • 24 Posts
                  Hi, I just got the same problem - not able to use &tplType=`embedded` in snippet [[ForgotPassword]]. Error was about the line 161 in login.class.php. I am using revo Login v.1.3.1.
                  And really, there is
                  $modx->setPlaceholders($properties);
                  in function where $modx is undefined. Simple fix is to change it to
                  $this->modx->setPlaceholders($properties);


                  How can I report this bug? Was trying to do bug report a couple of days ago but could not even create account.

                  Vlad
                    • 28215
                    • 4,149 Posts
                    You can file issues here: http://github.com/splittingred/Login/issues/

                    Thanks!
                      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com