-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Update null date check in blog layout #26516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| <?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())) : ?> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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
|
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. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26516. |
|
Thanks! |
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
Expiredbadge under article title.Actual result
Expiredbadge shown.Documentation Changes Required
No.