Skip to content

Conversation

@SharkyKZ
Copy link
Contributor

@SharkyKZ SharkyKZ commented Oct 8, 2019

Pull Request for Issue #26515

Summary of Changes

Updates layout to check for real null date.

Testing Instructions

Create some articles without publish down date.
Open category blog view.

Expected result

No Expired badge under article title.

Actual result

Expired badge shown.

Documentation Changes Required

No.

<?php if ($displayData->publish_down != Factory::getDbo()->getNullDate()
&& (strtotime($displayData->publish_down) < strtotime(Factory::getDate()))
) : ?>
<?php if ($displayData->publish_down !== null && strtotime($displayData->publish_down) < strtotime(Factory::getDate())) : ?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalize code?
In other files it is
<?php if (!is_null($this->item->publish_down)
Don't know what is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strict null comparison is generally faster than is_null(). There's PHP-CS-Fixer rule for removing is_null() uses which we could apply eventually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know that. Thanks for the info.

@infograf768
Copy link
Member

I have tested this item ✅ successfully on 34abc21


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26516.

1 similar comment
@alikon
Copy link
Contributor

alikon commented Oct 8, 2019

I have tested this item ✅ successfully on 34abc21


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26516.

@alikon
Copy link
Contributor

alikon commented Oct 8, 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26516.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 8, 2019
@wilsonge wilsonge merged commit a8698e4 into joomla:4.0-dev Oct 8, 2019
@wilsonge
Copy link
Contributor

wilsonge commented Oct 8, 2019

Thanks!

@joomla-cms-bot joomla-cms-bot added PR-4.0-dev and removed RTC This Pull Request is Ready To Commit labels Oct 8, 2019
@wilsonge wilsonge added this to the Joomla 4.0 milestone Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants