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

        Joaquim Cavalleri (Inactive) created issue -
        Joaquim Cavalleri (Inactive) made changes -
        Field Original Value New Value
        Status Open [ 1 ] Confirmed [ 10037 ]
        Gunnstein Lye made changes -
        Status Confirmed [ 10037 ] InputQ [ 10001 ]
        Gunnstein Lye made changes -
        Rank Ranked lower
        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?
        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 -

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

        Show
        Joaquim Cavalleri (Inactive) added a comment - @ Bertrand Dunogier , that's even better, I think.
        Joaquim Cavalleri (Inactive) made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        Assignee Joaquim Cavalleri [ joaquim.cavalleri@ez.no ]
        Show
        Joaquim Cavalleri (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/773
        Joaquim Cavalleri (Inactive) made changes -
        Status Development [ 3 ] Development review [ 10006 ]
        André Rømcke made changes -
        Fix Version/s 5.2-rc1 [ 12781 ]
        André Rømcke made changes -
        Affects Version/s 5.2-dev [ 12300 ]
        Bertrand Dunogier made changes -
        Affects Version/s 5.0 [ 10300 ]
        Show
        Joaquim Cavalleri (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-legacy/commit/40799e9d5a0ca787f2ae30aa025059f9afeeb784
        Joaquim Cavalleri (Inactive) made changes -
        Status Development review [ 10006 ] Development Review done [ 10028 ]
        Affects Version/s 4.6.0 [ 11005 ]
        Affects Version/s 4.5.0 [ 11000 ]
        Fix Version/s 4.5 Maintenance [ 12585 ]
        Fix Version/s 4.6 Maintenance [ 12584 ]
        Fix Version/s 4.7 Maintenance [ 12583 ]
        Fix Version/s 5.0 Maintenance [ 11287 ]
        Fix Version/s 5.1 Maintenance [ 12301 ]
        Joaquim Cavalleri (Inactive) made changes -
        Status Development Review done [ 10028 ] Documentation done [ 10011 ]
        Joao Pingo (Inactive) made changes -
        Status Documentation done [ 10011 ] QA [ 10008 ]
        Assignee Joaquim Cavalleri [ joaquim.cavalleri@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
        Joao Pingo (Inactive) made changes -
        Rank Ranked higher
        Joao Pingo (Inactive) made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 1 hour [ 3600 ]
        Worklog Id 40444 [ 40444 ]
        Joao Pingo (Inactive) logged work - 27/Sep/13 7:02 PM
        • Time Spent:
          1 hour
           

          Testing

        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
        Joao Pingo (Inactive) made changes -
        Assignee Joao Pingo [ joao.pingo@ez.no ]
        Status QA [ 10008 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Joao Pingo (Inactive) made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Joao Pingo (Inactive) made changes -
        Time Spent 1 hour [ 3600 ] 2 hours, 30 minutes [ 9000 ]
        Worklog Id 40484 [ 40484 ]
        Joao Pingo (Inactive) made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Joao Pingo (Inactive) logged work - 30/Sep/13 1:01 PM
        • Time Spent:
          1 hour, 30 minutes
           

          Tested and closed

        André Rømcke made changes -
        Workflow eZ Engineering Scrumban Workflow [ 59098 ] EZ* Development Workflow [ 84269 ]
        Alex Schuster made changes -
        Workflow EZ* Development Workflow [ 84269 ] EZEE Development Workflow [ 122915 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Confirmed Confirmed
        2m 2s 1 joaquim.cavalleri@ez.no 24/Sep/13 5:04 PM
        Confirmed Confirmed InputQ InputQ
        16h 28m 1 Gunnstein Lye 25/Sep/13 9:33 AM
        InputQ InputQ Development Development
        9h 34m 1 joaquim.cavalleri@ez.no 25/Sep/13 7:08 PM
        Development Development Development Review Development Review
        31s 1 joaquim.cavalleri@ez.no 25/Sep/13 7:08 PM
        Development Review Development Review Development Review done Development Review done
        23h 14m 1 joaquim.cavalleri@ez.no 26/Sep/13 6:22 PM
        Development Review done Development Review done Documentation Review done Documentation Review done
        1h 23m 1 joaquim.cavalleri@ez.no 26/Sep/13 7:46 PM
        Documentation Review done Documentation Review done QA QA
        16h 53m 1 Joao Pingo (Inactive) 27/Sep/13 12:40 PM
        QA QA Closed Closed
        2d 22h 38m 1 Joao Pingo (Inactive) 30/Sep/13 11:18 AM
        Closed Closed Reopened Reopened
        45m 36s 1 Joao Pingo (Inactive) 30/Sep/13 12:03 PM
        Reopened Reopened Closed Closed
        1s 1 Joao Pingo (Inactive) 30/Sep/13 12:03 PM

          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