Permalink
Browse files

MDL-25612 sql - make rss_client block cross-db

  • Loading branch information...
1 parent d911c72 commit 3612c3be4a372d6de62ef3e3062b6aa31c531789 @stronk7 stronk7 committed Feb 12, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 blocks/rss_client/edit_form.php
@@ -49,11 +49,12 @@ protected function specific_definition($mform) {
}
$rssfeeds = $DB->get_records_sql_menu('
- SELECT id, CASE WHEN preferredtitle = ? THEN title ELSE preferredtitle END AS acutaltitle
+ SELECT id,
+ CASE WHEN preferredtitle = ? THEN ' . $DB->sql_compare_text('title', 64) .' ELSE preferredtitle END
FROM {block_rss_client}
WHERE userid = ? OR shared = 1
- ORDER BY acutaltitle',
- array($DB->sql_empty(), $USER->id));
+ ORDER BY CASE WHEN preferredtitle = ? THEN ' . $DB->sql_compare_text('title', 64) . ' ELSE preferredtitle END ',
+ array($DB->sql_empty(), $USER->id, $DB->sql_empty()));
if ($rssfeeds) {
$select = $mform->addElement('select', 'config_rssid', get_string('choosefeedlabel', 'block_rss_client'), $rssfeeds);
$select->setMultiple(true);

0 comments on commit 3612c3b

Please sign in to comment.