?
avatar epidote
epidote
19 Oct 2016

Steps to reproduce the issue

As described here
https://forum.joomla.org/viewtopic.php?f=706&t=792975&view=unread&sid=2b6cba37ad96ea871c97b87a0acae857#unread
would be great to have a simple change that allows Front-end Article Sorting by unpublish Date to be able to order articles so that the most recent event is displayed first and then is unpublished after the event has passed.

Additional comments

have accomplished it, but only by adding

           <option value="unpublished">JUNPUBLISHED</option>

to the <field name="order_date" blog.xml and then adding

     case 'unpublished' :
        $queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END ';
        break;

to the function getQueryDate($orderDate) in com_content>helpers>query.php

bit of a nasty hack though, is there a better way to do it, can you override helpers and the .xml?

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar epidote epidote - open - 19 Oct 2016
avatar brianteeman
brianteeman - comment - 19 Oct 2016

There are plugins on the jed that will do this. No need for this edge case
to be in the core

On 19 Oct 2016 10:23 p.m., "epidote" notifications@github.com wrote:

Steps to reproduce the issue

As described here
https://forum.joomla.org/viewtopic.php?f=706&t=792975&view=unread&sid=
2b6cba37ad96ea871c97b87a0acae857#unread
would be great to have a simple change that allows Front-end Article
Sorting by unpublish Date to be able to order articles so that the most
recent event is displayed first and then is unpublished after the event has
passed.
Additional comments

have accomplished it, but only by adding

       <option value="unpublished">JUNPUBLISHED</option>

to the <field name="order_date" blog.xml and then adding

 case 'unpublished' :
    $queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END ';
    break;

to the function getQueryDate($orderDate) in com_content>helpers>query.php

bit of a nasty hack though, is there a better way to do it, can you
override helpers and the .xml?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12483, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8ZStUho5bhvOBX5tsqBTc7uiVkM_ks5q1opngaJpZM4KbeNd
.

avatar epidote
epidote - comment - 19 Oct 2016

Fair enough. But for the sake of 4 lines of code it may be useful to others and cease to be an edge case? I'd rather use Joomla core than load a plugin and with that small change it makes a very useful ordering.

avatar marclight
marclight - comment - 20 Oct 2016

I'm with epidote on this one. I've search for a plugin on the JED to sort a Category Blog Menu item with the unpublish date with no luck.

There's 4 dates in the publishing settings of an article. Why omit one in the sort settings...

Thanks.


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

avatar brianteeman
brianteeman - comment - 20 Oct 2016

Maybe it's no longer on the JED - sorry it's a long time since I had the
need for it.

Can I clarify if you are just talking about sorting on the field with no
extra functionality.

avatar marclight
marclight - comment - 20 Oct 2016

For me yes. I know you probably have a lot on your plate but we have around 10 sites that would benefit a lot from this.

Thanks again.

avatar brianteeman
brianteeman - comment - 20 Oct 2016

And would you want this in the admin sorting as well?

avatar marclight
marclight - comment - 20 Oct 2016

It would be useful but it's not a must.

avatar epidote
epidote - comment - 20 Oct 2016

as for marclight. admin sorting would be handy but not essential. The only thing I am suggesting it for is on a category blog menu, in the "date for ordering" (as attached).
BTW the ordering for the hack I describe at
https://forum.joomla.org/viewtopic.php?f=706&t=792975&view=unread&sid=
makes the "Article Order" seem wrong since to get the most recently unpublished the setting needs to be "Oldest First". But when you think about it in terms of the real purpose of the ordering it makes sense.
Thanks
untitled-1

avatar brianteeman
brianteeman - comment - 21 Oct 2016

For the admin see #11670

Yes it does seem wrong to me the setting for article order with the unpublished - not logical to me


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

avatar brianteeman
brianteeman - comment - 25 Oct 2016

Ok thanks for clarifying. I will write a pull request tomorrow for this but
then it will require testing AND approval

On 20 Oct 2016 10:59 p.m., "epidote" notifications@github.com wrote:

as for marclight. admin sorting would be handy but not essential. The only
thing I am suggesting it for is on a category blog menu, in the "date for
ordering" (as attached).
BTW the ordering for the hack I describe at
https://forum.joomla.org/viewtopic.php?f=706&t=792975&view=unread&sid=
makes the "Article Order" seem wrong since to get the most recently
unpublished
the setting needs to be "Oldest First". But when you think
about it in terms of the real purpose of the ordering it makes sense.
Thanks
[image: untitled-1]
https://cloud.githubusercontent.com/assets/8977589/19579457/8ca237d0-976c-11e6-94e9-d250a4e8b62d.jpg


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#12483 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8eaPWevYX4LTxZD_Ez-uIyBlCA2kks5q1-Q7gaJpZM4KbeNd
.

avatar marclight
marclight - comment - 25 Oct 2016

Thanks a lot! I just remembered again why I love open source so much :)

avatar brianteeman
brianteeman - comment - 25 Oct 2016

Sorry for the delay. The security issue took my time.

avatar brianteeman
brianteeman - comment - 29 Oct 2016

Closed as we have a PR #12615
I have also added the option to the Category List and Featured views as well as the requested blog

avatar brianteeman brianteeman - change - 29 Oct 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-10-29 01:18:20
Closed_By brianteeman
avatar brianteeman brianteeman - close - 29 Oct 2016

Add a Comment

Login with GitHub to post a comment