Skip to content

Schedule featured articles #13596#18052

Closed
eshiol wants to merge 36 commits intojoomla:stagingfrom
eshiol:staging
Closed

Schedule featured articles #13596#18052
eshiol wants to merge 36 commits intojoomla:stagingfrom
eshiol:staging

Conversation

@eshiol
Copy link
Copy Markdown
Contributor

@eshiol eshiol commented Sep 21, 2017

Pull Request for Issue #13596.

Summary of Changes

Added two fields in the article editor featured_up (Start Featured) and featured_down (End Featured)
image
An article is featured if featured is yes and (featured_up is null or is less than or is equal to now) and (featured_down is null or is greater than or is equal to now)

Testing Instructions

modify the database structure using the file 3.8.0-2017-09-21.sql
create 5 articles:

  1. not featured
  2. featured, featured_up = null, featured_down = null
  3. featured, featured_up = tomorrow, featured_down = null
  4. featured, featured_up = null, featured_down = yesterday
  5. featured, featured_up = yesterday, featured_down = tomorrow

Create an Articles » Featured Articles menu item
Create a News Flash module and set the option Featured Articles to Only show Featured Articles.

Expected result

Only the articles 2 and 5 will be shown in the Articles » Featured Articles menu item and in the News Flash module.

Actual result

Documentation Changes Required

@joomla-cms-bot
Copy link
Copy Markdown

Please add more information to your issue. Without test instructions and/or any description we will close this issue within 4 weeks. Thanks.
This is an automated message from the J!Tracker Application.

'ordering', 'a.ordering',
'featured', 'a.featured',
'featured_up', 'a.featured_up',
'featured_down', 'featured_down',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a.

{
$query->where('a.featured = 1');
}
$query->where('(a.featured_up = ' . $nullDate . ' OR a.featured_up <= ' . $nowDate . ')')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should these lines be after $query->where('a.featured = 1');?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think so. The full plain query could be produced by this piece of code

		if ($this->getState('filter.frontpage'))
		{
			// filter only featured articles
			$query->where('a.featured = 1')
				->where('(a.featured_up = ' . $nullDate . ' OR a.featured_up <= ' . $nowDate . ')')
				->where('(a.featured_down = ' . $nullDate . ' OR a.featured_down >= ' . $nowDate . ')');
			// join #__content_frontpage for ordering
			if ($orderby_sec === 'front')
			{
				$query->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id');
			}
		}

Articles have a row in the #__content_frontpage only if a.featured = 1, so you can optimize the query

		if ($this->getState('filter.frontpage'))
		{
			if ($orderby_sec === 'front')
			{
				$query->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id');
			}
			else
			{
				$query->where('a.featured = 1');
			}
			$query->where('(a.featured_up = ' . $nullDate . ' OR a.featured_up <= ' . $nowDate . ')')
				->where('(a.featured_down = ' . $nullDate . ' OR a.featured_down >= ' . $nowDate . ')');
		}

@@ -0,0 +1,2 @@
ALTER TABLE "#__content" ADD "featured_up" datetime2(0) NOT NULL DEFAULT '1900-01-01 00:00:00';
Copy link
Copy Markdown
Contributor

@Quy Quy Sep 22, 2017

Choose a reason for hiding this comment

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

I don't use sqlazure so I don't know which syntax " or [] is correct.
See another PR that uses []
https://github.com/joomla/joomla-cms/pull/17709/files#diff-f6d977844dc2f4c65fe3e3262b042bd6

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Sep 22, 2017

How about changing End to Finish to be consistent elsewhere like Finish Publishing?

@WoodyF4u
Copy link
Copy Markdown

Thanks for working on it to everybody who is joining this issue.
I am not a programmer or developer, so I can only watch and read.
Unfortunately it was not a part of Joomla! 3.8.0, I hope it will be part of one of the first Joomla! 3.8.x releases in the future.

COM_CONTENT_FIELD_CREATED_LABEL="Created Date"
COM_CONTENT_FIELD_FEATURED_DESC="Assign the article to the featured blog layout."
COM_CONTENT_FIELD_FEATURED_DOWN_DESC="An optional date to end the article being featured."
COM_CONTENT_FIELD_FEATURED_DOWN_LABEL="End Featured"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change to Finish

COM_CONTENT_FIELD_CREATED_DESC="Created date."
COM_CONTENT_FIELD_CREATED_LABEL="Created Date"
COM_CONTENT_FIELD_FEATURED_DESC="Assign the article to the featured blog layout."
COM_CONTENT_FIELD_FEATURED_DOWN_DESC="An optional date to end the article being featured."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change to finish

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Sep 25, 2017

In the Featured tooltip, seconds is displayed, but not in the Publishing tooltip. To be consistent, do not display the seconds.

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Sep 25, 2017

Installation SQLs have to be updated with the new columns.

$tips[] = JText::sprintf('JLIB_HTML_FEATURED_STARTED', JHtml::_('date', $featured_up, JText::_('DATE_FORMAT_LC5'), 'UTC'));
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove tabs.

$tips[] = JText::sprintf('JLIB_HTML_FEATURED_FINISH', JHtml::_('date', $featured_down, JText::_('DATE_FORMAT_LC5'), 'UTC'));
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove tabs.

{
$nullDate = JFactory::getDbo()->getNullDate();
$nowDate = JFactory::getDate()->toUnix();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove tab.


$featured_up = ($featured_up != $nullDate) ? JFactory::getDate($featured_up, 'UTC')->setTimeZone($tz) : false;
$featured_down = ($featured_down != $nullDate) ? JFactory::getDate($featured_down, 'UTC')->setTimeZone($tz) : false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove tab.

@johanpeters
Copy link
Copy Markdown

Hello.. what is the current status of this feature.. when will this be released or build in the core joomla?..
i need this feature for multiple website's.. as far as i can see and have tested it it works for me..

greetings.


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

@HLeithner
Copy link
Copy Markdown
Member

HLeithner commented Jan 17, 2019

@johanpeters 3.x series has a feature freeze, so this PR has to be ported to J4 and maybe get included in in Joomla 4.0

@brianteeman
Copy link
Copy Markdown
Contributor

@HLeithner you really need to announce (and define) this feature freeze and then review and update ALL the existing issues and PR.

No point in having open feature PR for the J3 branch
No point in having open feature Issues for the J3 branch

AND ensure that all new PR and Issues for the J3 branch are commented on appropriately - just leaving them there just creates frustration and WASTES TIME for everyone

@HLeithner
Copy link
Copy Markdown
Member

@brianteeman thats not my decision thats from the last Production meeting Report:
https://volunteers.joomla.org/departments/production/reports/936-production-meeting-december-2018

  • There was a discussion about . It was voted to reject this and stick to the current plan of having 3.10 as the bridge release for Joomla 4

Also reflected in the Roadmap https://developer.joomla.org/roadmap.html

  • Note: Joomla! 3.9 will be the last 3.x release with new features, all new features have to go into Joomla! 4.

I'm not in the position to say that this is valid for all PR's so maybe there are PR's that gets into a patch level which adds a small feature.

My comment may was not detailed enough, sry for this.

@brianteeman
Copy link
Copy Markdown
Contributor

There is a missing word or phrase in the minutes that says what the proposal was that was discussed - the community are not mind readers

@HLeithner
Copy link
Copy Markdown
Member

maybe @wilsonge can tell us more about this. I'm not part of the production team atm.

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Jan 17, 2019

We discussed this in the last days in the maintainers chat and George wanted to see with Sandra to write something.

@brianteeman
Copy link
Copy Markdown
Contributor

@Bakual thank you - I had given up ever getting a reply from @wilsonge

@joomla-cms-bot joomla-cms-bot changed the title [New Feature] Schedule featured articles #13596 Schedule featured articles #13596 Mar 29, 2019
@ghost ghost added the J3 Issue label Apr 5, 2019
@wilsonge
Copy link
Copy Markdown
Contributor

Let's get this rebased onto j4 and get a fresh test. seems like a nice feature :)

@ghost ghost removed the J3 Issue label Apr 19, 2019
@joomla-cms-bot
Copy link
Copy Markdown

Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/18052

@alikon
Copy link
Copy Markdown
Contributor

alikon commented May 11, 2019

As we are in feature freeze
all new features have to go into Joomla! 4.

Please rebase this nice feature in J4


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

@Quy
Copy link
Copy Markdown
Contributor

Quy commented Aug 23, 2019

PR #25979 rebased for J4


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.