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

unpublish cronjob uses anonymous credentials

    Details

      Description

      unpublish cronjob uses anonymous credentials, therefore it doesn't affect nodes in restricted areas of the site.

      steps to reproduce (in 4.x):

      . configure article class in content.ini|UnpublishSettings|ClassList
      . create an article and fill in unpublish_date field (to a date in the past)
      . set the node section to restricted
      . run "php runcronjobs.php" (unpublish.php will run)
      . verify that the object was not affected

      steps to reproduce (in 5.x):

      . configure a class to have a datetime field with unpublish_date as identifier
      . configure <your class> in content.ini|UnpublishSettings|ClassList
      . create an <your class> and fill in unpublish_date field (to a date in the past)
      . set the node section to restricted
      . run "php runcronjobs.php" (unpublish.php will run)
      . verify that the object was not affected

        Activity

        Hide
        Joao Pingo (Inactive) added a comment -

        Tested in 4.5, 4.6, 4.7, 5.0, 5.1, and Master
        All tests Passed ... QA Approved

        Show
        Joao Pingo (Inactive) added a comment - Tested in 4.5, 4.6, 4.7, 5.0, 5.1, and Master All tests Passed ... QA Approved
        Show
        Joaquim Cavalleri (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-legacy/commit/40799e9d5a0ca787f2ae30aa025059f9afeeb784
        Show
        Joaquim Cavalleri (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/773
        Hide
        Joaquim Cavalleri (Inactive) added a comment -

        @Bertrand Dunogier, that's even better, I think.

        Show
        Joaquim Cavalleri (Inactive) added a comment - @ Bertrand Dunogier , that's even better, I think.
        Hide
        Bertrand Dunogier added a comment - - edited

        What about the Limitation param ? (works like the fetch function param: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/list).

            $articleNodeArray = $rootNode->subTree( 
                array( 
                    'ClassFilterType' => 'include',
                    'ClassFilterArray' => $unpublishClasses;
                    'Limitation' => array()
                )
            );
        

        Show
        Bertrand Dunogier added a comment - - edited What about the Limitation param ? (works like the fetch function param: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/list ). $articleNodeArray = $rootNode->subTree( array( 'ClassFilterType' => 'include', 'ClassFilterArray' => $unpublishClasses; 'Limitation' => array() ) );
        Hide
        Joaquim Cavalleri (Inactive) added a comment - - edited

        Suggested workaround in the line of

         
        $currentDate = time();
         
        + $user = eZUser::fetchByName( 'admin' );
        + $userID = $user->attribute( 'contentobject_id' );
        + eZUser::setCurrentlyLoggedInUser( $user, $userID );
         
        foreach( $rootNodeIDList as $nodeID )
        {
            $rootNode = eZContentObjectTreeNode::fetch( $nodeID );
         
            $articleNodeArray = $rootNode->subTree( array( 'ClassFilterType' => 'include',
                                                            'ClassFilterArray' => $unpublishClasses ) );
        
        

        Should I pull request it?

        Show
        Joaquim Cavalleri (Inactive) added a comment - - edited Suggested workaround in the line of   $currentDate = time();   + $user = eZUser::fetchByName( 'admin' ); + $userID = $user->attribute( 'contentobject_id' ); + eZUser::setCurrentlyLoggedInUser( $user, $userID );   foreach( $rootNodeIDList as $nodeID ) { $rootNode = eZContentObjectTreeNode::fetch( $nodeID );   $articleNodeArray = $rootNode->subTree( array( 'ClassFilterType' => 'include', 'ClassFilterArray' => $unpublishClasses ) ); Should I pull request it?

          People

          • Assignee:
            Unassigned
            Reporter:
            Joaquim Cavalleri (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours, 30 minutes
              2h 30m