Bug 6729 - Article date modified function not found in atom webfeed plugin
Article date modified function not found in atom webfeed plugin
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: Plug-ins
2.3.7
All All
: P3 normal
Assigned To: Michael Felczak
: 7025 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-01 02:38 PDT by Ales Kladnik
Modified: 2012-03-12 10:44 PDT (History)
6 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments
Patch implementing Ales Kladnik's fix (644 bytes, patch)
2011-07-04 06:09 PDT, Pat Morin
Details | Diff
Patch against OJS 2.3.6 (683 bytes, patch)
2011-07-04 10:47 PDT, Michael Felczak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ales Kladnik 2011-07-01 02:38:39 PDT
I updated OJS to 2.3.5 using a patch from 2.3.4

The function for determining feed updated date in "atom.tpl" has an issue that breaks the execution of the template and ends the feed rendering after the title.

The problematic function is (lines 17-26 in atom.tpl):

 	{* Figure out feed updated date *}
 	{assign var=latestDate value=$issue->getDatePublished()}
 	{foreach name=sections from=$publishedArticles item=section}
 		{foreach from=$section.articles item=article}
			{if $article->getDateModified() > $latestDate}
 				{assign var=latestDate value=$article->getDateModified()}
 			{/if}
 		{/foreach}
 	{/foreach}
 	<updated>{$latestDate|date_format:"%Y-%m-%dT%T%z"|regex_replace:"/00$/":":00"}</updated>


I managed to get the feed working again by replacing $article->getDateModified() with $article->getDatePublished(). It seems that getDateModified() doesn't exist for article. I don't know though if the function for estimating feed date is now working as it was intended, but at least it works somehow.
Comment 1 Pat Morin 2011-07-04 06:09:54 PDT
Created attachment 3585 [details]
Patch implementing Ales Kladnik's fix
Comment 2 Pat Morin 2011-07-04 06:11:05 PDT
I had the same problem and Ales' fix worked for me.  I've attached it as a patch.
Comment 3 Michael Felczak 2011-07-04 10:44:52 PDT
Thanks, Ales and Pat for your help with this.

The getDateModified function has since been reneamed to getLastModified -- this was one place where it wasn't updated to the new name.
Comment 4 Michael Felczak 2011-07-04 10:47:21 PDT
Created attachment 3588 [details]
Patch against OJS 2.3.6
Comment 6 Michael Felczak 2011-07-04 10:51:16 PDT
Fixed.
Comment 7 James MacGregor 2012-03-12 10:44:23 PDT
*** Bug 7025 has been marked as a duplicate of this bug. ***