Commit b67b143b authored by Chris Wharton's avatar Chris Wharton
Browse files

Enhance tagged posts block - restrict tags

Bug #1027738

Restrict selectable tags to ones that apply to journal entries

Change-Id: I5228c0e5f06e6939c7fe93a07fc9b1cb4bf180f0
Signed-off-by: default avatarChris Wharton <>
parent e48c65f5
......@@ -134,9 +134,19 @@ class PluginBlocktypeTaggedposts extends SystemBlocktype {
public static function instance_config_form($instance) {
global $USER;
$configdata = $instance->get('configdata');
$tags = get_my_tags(null, false, 'alpha');
$tags = get_records_sql_array("
SELECT at.tag
FROM {artefact_tag} at
JOIN {artefact} a
ON = at.artefact
WHERE a.owner = ?
AND a.artefacttype = 'blogpost'
GROUP BY at.tag
", array($USER->id));
$options = array();
if (!empty($tags)) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment