Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-15061

ez scripts that declare support for use_session cannot print help text if db is in siteaccess

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 4.5.0
    • 4.0.6, 4.1.3
    • Misc
    • None

    Description

      It is a bit of a pain to get the list of options from an ezp php scripts that declares the need for a session, if the db declared in the main siteaccess is not available: ezp will try to start the session before echoing the help text and echo the help text before switching siteaccess -> php dies with an exception.

      The culprit is ezscript.php, around here:

                  if ( $options['help'] )
                  {
                      if ( !$this->IsInitialized )
                          $this->initialize();
                      $this->showHelp();
                      $this->shutdown( 0 );
                  }
      
                  if ( isset( $options['siteaccess'] ) and $options['siteaccess'] )
                      $this->setUseSiteAccess( $options['siteaccess'] );
      
                  if ( isset( $options['login'] ) and $options['login'] )
                      $this->setUser( $options['login'], isset( $options['password'] ) ? $options['password'] : false );
      
      

      The solution: echo the help text after calling setUseSiteAccess and setUser

                  if ( isset( $options['siteaccess'] ) and $options['siteaccess'] )
                      $this->setUseSiteAccess( $options['siteaccess'] );
      
                  if ( isset( $options['login'] ) and $options['login'] )
                      $this->setUser( $options['login'], isset( $options['password'] ) ? $options['password'] : false );
      
                  if ( $options['help'] )
                  {
                      if ( !$this->IsInitialized )
                          $this->initialize();
                      $this->showHelp();
                      $this->shutdown( 0 );
                  }
      

      The offending script: updatesearchindexdata in ezfind...

      Attachments

        Activity

          People

            andre1 andre1
            72f8acac-185f-4a54-9470-a7473f50daab@accounts.ibexa.co Gaetano Giunta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: