Permalink
Browse files

[#32662] Feed information missing in RSS type Syndication Feed (Fix #…

  • Loading branch information...
1 parent c2018b2 commit 81f1c402212b5bcf07cbb69ab474d57370cd31de @wilsonge wilsonge committed with mbabker Nov 16, 2013
@@ -19,6 +19,12 @@
class ContactViewCategory extends JViewCategoryfeed
{
/**
+ * @var string The name of the view to link individual items to
+ * @since 3.2
+ */
+ protected $viewName = 'contact';
+
+ /**
* Method to reconcile non standard names from components to usage in this class.
* Typically overriden in the component feed view class.
*
@@ -19,6 +19,12 @@
class ContentViewCategory extends JViewCategoryfeed
{
/**
+ * @var string The name of the view to link individual items to
+ * @since 3.2
+ */
+ protected $viewName = 'article';
+
+ /**
* Method to reconcile non standard names from components to usage in this class.
* Typically overriden in the component feed view class.
*
@@ -18,4 +18,9 @@
*/
class WeblinksViewCategory extends JViewCategoryfeed
{
+ /**
+ * @var string The name of the view to link individual items to
+ * @since 3.2
+ */
+ protected $viewName = 'weblink';
}
@@ -25,11 +25,14 @@ $ -> Language fix or change
- -> Removed
! -> Note
+16-Nov-2013 Michael Babker
+ # [#32662] Feed information missing in RSS type Syndication Feed. Thanks George Wilson
+
13-Nov-2013 Jean-Marie Simonet
# [#32412] protostar error page logo Thanks David Beuving
+ [#32660] TinyMCE editor lacks link relation option Thanks Artur Stępień
- # [#32626] *Banners Manager: Options is gone when filtering by a category
- +$ [#32678] TinyMCE 4 in Joomla 3.2 has no image advanced options
+ # [#32626] *Banners Manager: Options is gone when filtering by a category
+ +$ [#32678] TinyMCE 4 in Joomla 3.2 has no image advanced options
# [#32672] Fixed problem with featured view Thanks Bruno Batista
$ [#32546] Language strings missing for com_tags Thanks George Wilson
$ [#32680] Missing string Thanks David Jardin
@@ -33,6 +33,25 @@ public function display($tpl = null)
$document = JFactory::getDocument();
$extension = $app->input->getString('option');
+ $contentType = $extension . '.' . $this->viewName;
+
+ $ucmType = new JUcmType;
+ $ucmRow = $ucmType->getTypeByAlias($contentType);
+ $ucmMapCommon = json_decode($ucmRow->field_mappings)->common;
+ $createdField = null;
+ $titleField = null;
+
+ if (is_object($ucmMapCommon))
+ {
+ $createdField = $ucmMapCommon->core_created_time;
+ $titleField = $ucmMapCommon->core_title;
+ }
+ elseif (is_array($ucmMapCommon))
+ {
+ $createdField = $ucmMapCommon[0]->core_created_time;
+ $titleField = $ucmMapCommon[0]->core_title;
+ }
+
$document->link = JRoute::_(JHelperRoute::getCategoryRoute($app->input->getInt('id'), $language = 0, $extension));
$app->input->set('limit', $app->get('feed_limit'));
@@ -55,17 +74,32 @@ public function display($tpl = null)
$this->reconcileNames($item);
// Strip html from feed item title
- $title = $this->escape($item->title);
- $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
+ if ($titleField)
+ {
+ $title = $this->escape($item->$titleField);
+ $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
+ }
+ else
+ {
+ $title = '';
+ }
// URL link to article
$router = new JHelperRoute;
- $link = JRoute::_($router->getRoute($item->id, $item->catid));
+ $link = JRoute::_($router->getRoute($item->id, $contentType, null, null, $item->catid));
// Strip HTML from feed item description text.
$description = $item->description;
$author = $item->created_by_alias ? $item->created_by_alias : $item->author;
- $date = isset($item->date) ? date('r', strtotime($item->date)) : '';
+
+ if ($createdField)
+ {
+ $date = isset($item->$createdField) ? date('r', strtotime($item->$createdField)) : '';
+ }
+ else
+ {
+ $date = '';
+ }
// Load individual item creator class.
$feeditem = new JFeedItem;

2 comments on commit 81f1c40

@effidoc
effidoc commented on 81f1c40 Dec 2, 2013

hello

I tried the patch found in github but now there is error 500 on url created by the feed to real menu item but with bad suffix for example

?view=&id=163&catid=12

http://mydomain.com/a-faire-et-a-voir/nouvelles.html?view=&id=163&catid=12

instead of

http://mydomain.com/a-faire-et-a-voir/nouvelles/163-search-engine-friendly-link

@Bakual
Collaborator
Bakual commented on 81f1c40 Dec 2, 2013

@effidoc If there is an issue with the current code, please open a new tracker on http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8103 so it can get fixed.
Commenting on a two week old commit will not raise the needed attention.

Please sign in to comment.