User tests: Successful: Unsuccessful:
Pull Request for Issue #26660
Null Date is now defined by null
and no more by Factory::getDbo()->getNullDate()
Create a site or admin module and enter a date for the Start Publishing.
Although no Finish Publishing date is set, the tooltip will display a wrong finish date.
Remains in core 3 files with instances of Factory::getDbo()->getNullDate()
/layouts/joomla/content/icons/edit.php:25: || ((strtotime($article->publish_down) < strtotime(Factory::getDate())) && $article->publish_down != Factory::getDbo()->getNullDate()))
/layouts/joomla/content/icons/edit.php:35: || ((strtotime($article->publish_down) < strtotime(Factory::getDate())) && $article->publish_down != Factory::getDbo()->getNullDate()))
/libraries/src/Form/Field/CalendarField.php:228: if ($this->value && $this->value != Factory::getDbo()->getNullDate())
/libraries/src/Form/Field/CalendarField.php:240: if ($this->value && $this->value != Factory::getDbo()->getNullDate())
/libraries/src/Form/Field/CalendarField.php:253: if ($this->value && $this->value != Factory::getDbo()->getNullDate() && strtotime($this->value) !== false)
/libraries/src/HTML/HTMLHelper.php:1115: if ($value && $value !== Factory::getDbo()->getNullDate() && strtotime($value) !== false)
I did not touch these as I was not sure where to test them.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
@richard67
There are many other variations of ->getNullDate
;)
@infograf768 I know. Not all of them shall be thrown away, some of them we need to keep for 3rd party extensions. But a check for real NULL should be added. Maybe @wilsonge can check hf the changes here are ok. To me they seem to be ok.
I have tested this item
Confirm Before Patch & After Patch, but on both I hv this.
Info: Tested on beta-1 (nightly from yesterday)
@ChristineWk
The date is in the past.
Please try to also modify Factory::getDbo()->getNullDate()
to null
in
/layouts/joomla/content/icons/edit.php:25: || ((strtotime($article->publish_down) < strtotime(Factory::getDate())) && $article->publish_down != Factory::getDbo()->getNullDate()))
/layouts/joomla/content/icons/edit.php:35: || ((strtotime($article->publish_down) < strtotime(Factory::getDate())) && $article->publish_down != Factory::getDbo()->getNullDate()))
If we want to support 3rd party extensions with this layout which doesn't null as date type we have to keep getNullDate and just add a === NULL to the if-statement.
If we don't want to support this, you can remove the $nullDate variable completely. Since we still have getNullDate in the near future (4.x) we should support it in the layout too.
Please change
($publish_up != $nullDate)
to
($publish_up !== NULL &&$publish_up != $nullDate)
thx
Please change
($publish_up != $nullDate)
to
($publish_up !== NULL &&$publish_up != $nullDate)
Should be lowercase null
for PHP CS.
@infograf768 In PublishedButton.php the checks in lines 89 and 95 should also be corrected. They were wrong before nulldate changes, too, because in lines 63 and 64 the datetimes are set to null
. If you want I can check tonight after work and send you a PR to your branch.
If you want I can check tonight after work and send you a PR to your branch.
Thanks, please do and correct all.
Trashed previous and made new with tomorrow date :-)
Yup we need to keep compat in the libraries please. but we can definitely mark as deprecated
Labels |
Added:
?
|
I merged @richard67 patch into this. It works fine for me.
Do we also need to modify /layouts/joomla/content/icons/edit.php
?
It looks like it is only used for legacy:
$text = LayoutHelper::render('joomla.content.icons.edit', array('article' => $article, 'overlib' => $overlib, 'legacy' => $legacy));
@ChristineWk
Please test again.
Do we also need to modify /layouts/joomla/content/icons/edit.php ?
That was for the icon on front end editing iirc
@ChristineWk If I understand the functionality right, the above is correct. Pending means publish up is in future. Today is the 21st.
Or do I maybe understand the issue wrong?
I have tested this item
Before patch: A publish down time is shown in the tool tip even if no publish down time was set.
After patch: Publish down time is only shown if really set.
The icon and tool tip is set according to the times (expired if publish down in past, pending if publish up in future, published if publish up in past and publish down in future or no publish down set).
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
If nobody else wants to do that, I will make another PR for /layouts/joomla/content/icons/edit.php
... but it may take a while, not sure if I will get it finished otday with testing instructions.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-10-25 20:47:22 |
Closed_By | ⇒ | wilsonge |
Thanks!
@infograf768 Was on my task list, but you were faster. Code looks good to me. Will test tonight after work.