Skip to content

Commit

Permalink
[#32662] Feed information missing in RSS type Syndication Feed (Fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge authored and Michael Babker committed Nov 16, 2013
1 parent c2018b2 commit 81f1c40
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 6 deletions.
6 changes: 6 additions & 0 deletions components/com_contact/views/category/view.feed.php
Expand Up @@ -18,6 +18,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.
Expand Down
6 changes: 6 additions & 0 deletions components/com_content/views/category/view.feed.php
Expand Up @@ -18,6 +18,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.
Expand Down
5 changes: 5 additions & 0 deletions components/com_weblinks/views/category/view.feed.php
Expand Up @@ -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';
}
7 changes: 5 additions & 2 deletions installation/CHANGELOG
Expand Up @@ -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
Expand Down
42 changes: 38 additions & 4 deletions libraries/legacy/view/categoryfeed.php
Expand Up @@ -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'));
Expand All @@ -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;
Expand Down

2 comments on commit 81f1c40

@effidoc
Copy link

@effidoc effidoc commented on 81f1c40 Dec 2, 2013

Choose a reason for hiding this comment

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

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
Copy link
Contributor

@Bakual Bakual commented on 81f1c40 Dec 2, 2013

Choose a reason for hiding this comment

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

@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.