? Pending

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
6 Feb 2018

Summary of Changes

The Joomla\CMS\Document\Document API supports setting a response's modified date, however this method is actually unused in core therefore nothing actually sets this to have found that it is broken. The Document API takes this value as a string, however the property it sets in Joomla\CMS\Application\WebApplication is expected to be a Joomla\CMS\Date\Date object. Using the current behavior, even if one were to call $document->setModifiedDate('2017-12-31'); the value would never be set as a response header because the web application validates the property is a Date object before processing it.

This PR addresses the type mismatching by documenting the $_mdate property of the Document as supporting either a string or a Date object, converts the value to a Date object if it is a string before setting it to the application for use in the response headers, and changes the setModifiedDate() method to type check and throw an Exception if an invalid type is given.

Testing Instructions

Code review as this code path is unused in core.

avatar mbabker mbabker - open - 6 Feb 2018
avatar mbabker mbabker - change - 6 Feb 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Feb 2018
Category Libraries
avatar zero-24
zero-24 - comment - 7 Feb 2018

Merging on review. Thanks!

avatar zero-24 zero-24 - change - 7 Feb 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-02-07 00:31:12
Closed_By zero-24
Labels Added: ?
avatar zero-24 zero-24 - close - 7 Feb 2018
avatar zero-24 zero-24 - merge - 7 Feb 2018

Add a Comment

Login with GitHub to post a comment