Issue Details (XML | Word | Printable)

Key: MDL-13932
Type: Task Task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Dan Poltawski
Reporter: Nicolas Connault
Votes: 1
Watchers: 4
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Rewrite RSS block

Created: 14/Mar/08 07:57 PM   Updated: 30/Jul/09 10:14 PM
Return to search
Component/s: RSS
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: 1. Text File rssrework250609.patch (67 kB)

Issue Links:
Relates
 

Participants: Charles Fulton, Dan Poltawski, Nicolas Connault, Petr Skoda and Tim Hunt
Security Level: None
Resolved date: 30/Jul/09
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Update simplepie lib to latest version and use it instead of magpie. Rewrite role-related code so that the block finally works well for student submissions and on the MyMoodle page.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) made changes - 15/Mar/08 12:54 AM
Field Original Value New Value
Link This issue has a non-specific relationship to MDL-7946 [ MDL-7946 ]
Charles Fulton added a comment - 18/Jul/08 01:44 AM
There's traction on #7946--a patch for using simple instead of magpie has been submitted. This has no effect on the role issue.

Dan Poltawski added a comment - 12/Apr/09 06:35 AM - edited
I am in the middle of doing this, converting to simplepie and refactoring the block a lot

see:
http://git.danpoltawski.co.uk/?p=moodle.git;a=shortlog;h=refs/heads/simplepie


Dan Poltawski made changes - 12/Apr/09 06:35 AM
Assignee Nicolas Connault [ nicolasconnault ] Dan Poltawski [ poltawski ]
Dan Poltawski added a comment - 13/Apr/09 10:49 PM
Please review the attached rework of the RSS block.

With this refactor i've:

  • Moved to simplepie
  • Done a big cleanup of code, fixing some issues like lack of sesskey protection/proper capability checking
  • Tried not to change the output at this stage

I've tried to leave alone bits which might be affected by tims navigation 2.0 stuff alone & keep the output/weird behaviour as it was.

You can see a log of the commits here:
http://git.danpoltawski.co.uk/?p=moodle.git;a=shortlog;h=88ee1346b1092767f9ca90fde015102242664881

blocks/rss_client/block_rss_client.php | 477 +-
blocks/rss_client/block_rss_client_action.php | 384 +-
blocks/rss_client/block_rss_client_error.php | 10 +-
blocks/rss_client/config_instance.html | 10 +-
blocks/rss_client/db/upgrade.php | 13 +-
blocks/rss_client/locallib.php | 177 +
blocks/rss_client/settings.php | 11 +-
lang/en_utf8/block_rss_client.php | 1 +
lib/blocklib.php | 2 +-
lib/rsslib.php | 197 +-
lib/simplepie/moodle_simplepie.php | 112 +
lib/simplepie/readme_moodle.txt | 11 +
lib/simplepie/simplepie.inc |13672 +++++++++++++++++++++++++
lib/simpletest/testrss.php | 76 +
14 files changed, 14476 insertions, 677 deletions


Dan Poltawski made changes - 13/Apr/09 10:49 PM
Attachment rssrework01.patch [ 16870 ]
Dan Poltawski committed 4 files to 'Moodle CVS' - 13/Apr/09 11:29 PM
Adding SimplePie feed parsing library MDL-7946, MDL-13932

To replace unmaintained magipie. Simplepie is actively maintained has some
nice features such as feed autodisovery. Implemented a simple extended class
which uses the Moodle core curl class from filelib.

Added unit test using the moodle.org sample files. Please note these tests will
fail if moodle can't make http connections out, so ensure proxy settings
etc are correct.
ADD lib/simplepie/simplepie.inc   Rev. 1.1    (+0 -0 lines)
ADD lib/simplepie/readme_moodle.txt   Rev. 1.1    (+0 -0 lines)
ADD lib/simpletest/testrss.php   Rev. 1.1    (+0 -0 lines)
ADD lib/simplepie/moodle_simplepie.php   Rev. 1.1    (+0 -0 lines)
Dan Poltawski added a comment - 13/Apr/09 11:36 PM
Uploading rssrework02.patch as i've now commited the simplepie library as suggested by Petr

blocks/rss_client/block_rss_client.php | 477 +++++++++++++------------
blocks/rss_client/block_rss_client_action.php | 384 ++++++++------------
blocks/rss_client/config_instance.html | 10 +-
blocks/rss_client/db/upgrade.php | 13 +-
blocks/rss_client/locallib.php | 177 +++++++++
blocks/rss_client/settings.php | 11 +-
lang/en_utf8/block_rss_client.php | 1 +
lib/rsslib.php | 197 +----------
8 files changed, 599 insertions, 671 deletions


Dan Poltawski made changes - 13/Apr/09 11:36 PM
Attachment rssrework02.patch [ 16871 ]
Dan Poltawski committed 2 files to 'Moodle CVS' - 14/Apr/09 12:00 AM
simplepie: fix class name caseing: MDL-7946, MDL-13932
MODIFY lib/simplepie/moodle_simplepie.php   Rev. 1.2    (+4 -4 lines)
MODIFY lib/simpletest/testrss.php   Rev. 1.2    (+3 -3 lines)
Dan Poltawski added a comment - 14/Apr/09 03:19 AM
Revised to fix the casing problems

Dan Poltawski made changes - 14/Apr/09 03:19 AM
Attachment rssrework03.patch [ 16873 ]
Petr Skoda added a comment - 14/Apr/09 04:00 AM
The patch is confusing my Netbeans, it just creates dev/null directory in my checkout :-O
I suppose the problem is in:
— a/blocks/rss_client/block_rss_client.php
+++ b/blocks/rss_client/block_rss_client.php

Dan Poltawski made changes - 14/Apr/09 05:19 AM
Attachment rssrework03-sedded.patch [ 16874 ]
Dan Poltawski made changes - 14/Apr/09 05:23 AM
Attachment patch_series.patch [ 16875 ]
Dan Poltawski made changes - 14/Apr/09 05:24 AM
Attachment danp_series1.patch [ 16876 ]
Dan Poltawski added a comment - 14/Apr/09 05:57 AM
Finally - a patch which applies to CVS atm..

Dan Poltawski made changes - 14/Apr/09 05:57 AM
Attachment cvs-compatible03.patch [ 16877 ]
Dan Poltawski made changes - 14/Apr/09 07:26 AM
Comment [ patch -p0 < /home/danp/rssrework03-sedded.patch ]
Dan Poltawski made changes - 14/Apr/09 07:26 AM
Comment [ Trying the patch series.. ]
Dan Poltawski made changes - 14/Apr/09 07:26 AM
Comment [ Please ignore that last attachment - it was Tims patch! ]
Dan Poltawski added a comment - 14/Apr/09 07:27 AM
Note to readers: cvs-compatible03.patch is the patch of interest atm

(I can't remove the existing patches)


Dan Poltawski added a comment - 26/Jun/09 02:15 AM
Attaching latest patch against head which works with Tims pagelib changes.

Dan Poltawski made changes - 26/Jun/09 02:15 AM
Attachment rssrework250609.patch [ 17766 ]
Tim Hunt made changes - 21/Jul/09 07:03 PM
Attachment cvs-compatible03.patch [ 16877 ]
Tim Hunt made changes - 21/Jul/09 07:03 PM
Attachment danp_series1.patch [ 16876 ]
Tim Hunt made changes - 21/Jul/09 07:04 PM
Attachment patch_series.patch [ 16875 ]
Tim Hunt made changes - 21/Jul/09 07:05 PM
Attachment rssrework01.patch [ 16870 ]
Tim Hunt made changes - 21/Jul/09 07:05 PM
Attachment rssrework02.patch [ 16871 ]
Tim Hunt made changes - 21/Jul/09 07:06 PM
Attachment rssrework03-sedded.patch [ 16874 ]
Tim Hunt made changes - 21/Jul/09 07:06 PM
Attachment rssrework03.patch [ 16873 ]
Dan Poltawski committed 2 files to 'Moodle CVS' - 27/Jul/09 10:18 PM
lib/simplepie: Improve Integration MDL-7946, MDL-13932

Added more unit tests, improved style and fixed:
- Failed behaviour of redirects
- Incorrect behaviour on feed retrival failure
- Ensured rss cache clear for unit test setup
MODIFY lib/simpletest/testrss.php   Rev. 1.4    (+54 -9 lines)
MODIFY lib/simplepie/moodle_simplepie.php   Rev. 1.4    (+47 -19 lines)
tjhunt committed 14 files to 'Moodle CVS' - 29/Jul/09 07:18 PM
block_rss_client: MDL-13932 Clean up a lot of the crap.

This was all in order to do MDL-19889!

* The old tabbed interface is gone.
* The manage feeds UI has been completely rewritten to be a few
separate sane scripts like managefeeds.php, editfeed.php and viewfeed.php
* This is used from both Admin -> plugins -> blocks ... and as a link from the block edit_form.php
* new edit_form.php for the block replacing config_istance.php.
* A lot of stuff to do with UI specific to this block has been removed from rsslib.php
DEL blocks/rss_client/Attic/block_rss_client_error.php   Rev. 1.8    (+0 -0 lines)
MODIFY blocks/rss_client/settings.php   Rev. 1.2    (+2 -5 lines)
MODIFY blocks/rss_client/db/access.php   Rev. 1.9    (+0 -23 lines)
MODIFY lang/en_utf8/block_rss_client.php   Rev. 1.8    (+7 -1 lines)
MODIFY blocks/rss_client/block_rss_client.php   Rev. 1.94    (+18 -57 lines)
MODIFY lib/rsslib.php   Rev. 1.62    (+4 -182 lines)
DEL blocks/rss_client/Attic/config_instance.html   Rev. 1.41    (+0 -0 lines)
DEL blocks/rss_client/Attic/config_instance_tabs.php   Rev. 1.17    (+0 -0 lines)
ADD blocks/rss_client/editfeed.php   Rev. 1.1    (+0 -0 lines)
ADD blocks/rss_client/viewfeed.php   Rev. 1.1    (+0 -0 lines)
DEL blocks/rss_client/Attic/block_rss_client_action.php   Rev. 1.69    (+0 -0 lines)
ADD blocks/rss_client/managefeeds.php   Rev. 1.1    (+0 -0 lines)
MODIFY lang/en_utf8/error.php   Rev. 1.198    (+2 -1 lines)
ADD blocks/rss_client/edit_form.php   Rev. 1.1    (+0 -0 lines)
Tim Hunt added a comment - 29/Jul/09 07:19 PM
I just did a huge chunk of changes to the manage feeds UI in head. I hope it is not too badly broken. The code is certainly cleaner (but could probably do with a few more comments).

Dan Poltawski committed 1 file to 'Moodle CVS' - 29/Jul/09 09:13 PM
block_rss_client: MDL-13932 Fix equality typo
MODIFY blocks/rss_client/editfeed.php   Rev. 1.2    (+1 -1 lines)
Dan Poltawski committed 3 files to 'Moodle CVS' - 29/Jul/09 09:44 PM
block_rss_client: MDL-13932/MDL-7946 - Switch to use Simplepie

Simplepie is actively maintained and supports a broader range of feeds
MODIFY blocks/rss_client/block_rss_client.php   Rev. 1.95    (+195 -172 lines)
MODIFY blocks/rss_client/editfeed.php   Rev. 1.3    (+6 -9 lines)
MODIFY blocks/rss_client/viewfeed.php   Rev. 1.2    (+8 -19 lines)
Dan Poltawski added a comment - 29/Jul/09 09:46 PM
I took the next step and commited the switch to simplepie using a subset of my previous changes. I will remove some of the other obsolete references and wait for a final OK before removing magpie completely

Mitsuhiro Yoshida committed 3 files to 'Lang CVS' - 30/Jul/09 12:13 AM
MDL-13932 Translated new strings for RSS block.
MODIFY ja_utf8/README   Rev. 1.1038    (+1 -1 lines)
MODIFY ja_utf8/error.php   Rev. 1.144    (+2 -1 lines)
MODIFY ja_utf8/block_rss_client.php   Rev. 1.11    (+7 -1 lines)
martignoni committed 2 files to 'Lang CVS' - 30/Jul/09 01:24 AM
MDL-13932, some strings added
MODIFY fr_utf8/error.php   Rev. 1.201    (+1 -0 lines)
MODIFY fr_utf8/block_rss_client.php   Rev. 1.12    (+7 -1 lines)
Dan Poltawski added a comment - 30/Jul/09 10:14 PM
Closing this and going to file seperate issues for problems as I find them.

Dan Poltawski made changes - 30/Jul/09 10:14 PM
Fix Version/s 2.0 [ 10122 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Dan Poltawski committed 13 files to 'Moodle CVS' - 30/Jul/09 10:49 PM
Remove lib/magpie: MDL-7946/MDL-13932

It is no longer maintained and simplepie has
replaced it as a maintained and robust alternative
DEL lib/magpie/Attic/README   Rev. 1.2    (+0 -0 lines)
DEL lib/magpie/Attic/TROUBLESHOOTING   Rev. 1.2    (+0 -0 lines)
DEL lib/magpie/Attic/rss_utils.inc   Rev. 1.4    (+0 -0 lines)
DEL lib/magpie/htdocs/Attic/index.html   Rev. 1.2    (+0 -0 lines)
DEL lib/magpie/Attic/rss_cache.inc   Rev. 1.3    (+0 -0 lines)
DEL lib/magpie/Attic/CHANGES   Rev. 1.2    (+0 -0 lines)
DEL lib/magpie/Attic/AUTHORS   Rev. 1.2    (+0 -0 lines)
MODIFY lib/thirdpartylibs.xml   Rev. 1.13    (+0 -7 lines)
DEL lib/magpie/Attic/rss_fetch.inc   Rev. 1.10    (+0 -0 lines)
DEL lib/magpie/Attic/README_MOODLE.txt   Rev. 1.5    (+0 -0 lines)
DEL lib/magpie/Attic/cookbook   Rev. 1.2    (+0 -0 lines)
DEL lib/magpie/htdocs/Attic/cookbook.html   Rev. 1.2    (+0 -0 lines)
DEL lib/magpie/Attic/rss_parse.inc   Rev. 1.4    (+0 -0 lines)
Dan Poltawski committed 1 file to 'Moodle CVS' - 01/Aug/09 05:19 AM
blocks/rss_client: MDL-13932 fix config_shownumentries typo

This caused incorrect rules/defaults to be added

Also add client side validation of the number
MODIFY blocks/rss_client/edit_form.php   Rev. 1.3    (+4 -3 lines)
Dan Poltawski committed 1 file to 'Moodle CVS' - 01/Aug/09 05:19 AM
blocks/rss_client: MDL-13932 Incease timeout when adding feeds

In order to stop 'slow loading feeds' causing performance problems
with standard moodle pages, i've set the timeout for simplepie quite
low. When cron runs i've set this timeout high and cache duration low.

The intention is that cron does all the hard work of connecting to remote
sites and users get this fast fast fast from cache.

However, in the case of adding a feed its probably better to try and get the
feed more agressively..
MODIFY blocks/rss_client/editfeed.php   Rev. 1.4    (+5 -1 lines)
Dan Poltawski committed 1 file to 'Moodle CVS' - 01/Aug/09 05:20 AM
blocks/rss_client: MDL-13932: viewfeed.php typo

link -> description
MODIFY blocks/rss_client/viewfeed.php   Rev. 1.3    (+1 -1 lines)
Dan Poltawski committed 1 file to 'Moodle CVS' - 01/Aug/09 05:20 AM
blocks/rss_client: MDL-13932 Fix typo when editting feed

This caused loss of which course we were adding/edditing a feed to.
MODIFY blocks/rss_client/editfeed.php   Rev. 1.5    (+1 -1 lines)
Dan Poltawski committed 1 file to 'Moodle CVS' - 06/Aug/09 12:38 AM
blocks/rss_client: MDL-13932 - alter output formating

Doesn't make much sense to have FORMAT_MOODLE for external
rss content.
MODIFY blocks/rss_client/block_rss_client.php   Rev. 1.98    (+1 -1 lines)
Dan Poltawski committed 1 file to 'Moodle CVS' - 24/Aug/09 01:56 AM
blocks/rss_client MDL-13932 Fix wrong param order in $OUTPUT->link()
MODIFY blocks/rss_client/managefeeds.php   Rev. 1.6    (+1 -1 lines)