Coder Social home page Coder Social logo

tag_tools's Introduction

Tag Tools

Elgg 6.0 Lint Checks Latest Stable Version License

Offers enhancements/tools for tags

Features

  • adds option to follow tags
  • content created with the tag sends notification to follower
  • tag follow configuration can be found at the notifications settings page
  • adds an improved version of the tagcloud widget

Notifications

The tag notifications can be send out using one of the following methods:

  • (default) as a separate notification with only information about the tag.
  • as an extension on the existing create notification. The tag followers will be added to the subscribers and the content of the notification will be appended with some text to indicate the recipient received this notification because of the tags he/she followed.

Which method is used can be configured in the plugin settings.

tag_tools's People

Contributors

fxnion avatar jdalsem avatar jeabakker avatar juho-jaakkola avatar yaco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tag_tools's Issues

notifications generate errors

i have been seeing some notifications of internal server errors after adding new videolist videos to my (elgg 2.1) site - since the error message only mentions tag tools, i think the error is caused by the notification that tag tools is generating. this is the error dump i see:

    Call to undefined method ElggRelationship::getContainerGUID()

    Error Object
(
    [message:protected] => Call to undefined method ElggRelationship::getContainerGUID()
    [string:Error:private] => Error: Call to undefined method ElggRelationship::getContainerGUID() in /mysite/vendor/elgg/elgg/engine/classes/Elgg/Notifications/SubscriptionsService.php:66
Stack trace:
#0 /mysite/vendor/elgg/elgg/engine/classes/Elgg/Notifications/NotificationsService.php(209): Elgg\Notifications\SubscriptionsService->getSubscriptions(Object(Elgg\Notifications\Event))
#1 /mysite/vendor/elgg/elgg/engine/lib/notification.php(188): Elgg\Notifications\NotificationsService->processQueue(1472670047)
#2 [internal function]: _elgg_notifications_cron('cron', 'minute', '', Array)
#3 /mysite/vendor/elgg/elgg/engine/classes/Elgg/PluginHooksService.php(38): call_user_func_array('_elgg_notificat...', Array)
#4 /mysite/vendor/elgg/elgg/engine/lib/elgglib.php(815): Elgg\PluginHooksService->trigger('cron', 'minute', Array, '')
#5 /mysite/vendor/elgg/elgg/engine/lib/cron.php(122): elgg_trigger_plugin_hook('cron', 'minute', Array, '')
#6 [internal function]: _elgg_cron_page_handler(Array, 'cron')
#7 /mysite/vendor/elgg/elgg/engine/classes/Elgg/Router.php(95): call_user_func('_elgg_cron_page...', Array, 'cron')
#8 /mysite/vendor/elgg/elgg/engine/classes/Elgg/Application.php(428): Elgg\Router->route(Object(Elgg\Http\Request))
#9 /mysite/vendor/elgg/elgg/engine/classes/Elgg/Application.php(371): Elgg\Application->run()
#10 /mysite/index.php(8): Elgg\Application::index()
#11 {main}
    [code:protected] => 0
    [file:protected] => /mysite/vendor/elgg/elgg/engine/classes/Elgg/Notifications/SubscriptionsService.php
    [line:protected] => 66
    [trace:Error:private] => Array
        (
            [0] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/classes/Elgg/Notifications/NotificationsService.php
                    [line] => 209
                    [function] => getSubscriptions
                    [class] => Elgg\Notifications\SubscriptionsService
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Elgg\Notifications\Event Object
                                (
                                    [action:protected] => create
                                    [object_type:protected] => relationship
                                    [object_subtype:protected] => tag_tools:notification
                                    [object_id:protected] => 121282
                                    [actor_guid:protected] => 2
                                )

                        )

                )

            [1] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/lib/notification.php
                    [line] => 188
                    [function] => processQueue
                    [class] => Elgg\Notifications\NotificationsService
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 1472670047
                        )

                )

            [2] => Array
                (
                    [function] => _elgg_notifications_cron
                    [args] => Array
                        (
                            [0] => cron
                            [1] => minute
                            [2] => 
                            [3] => Array
                                (
                                    [time] => 1472670002
                                )

                        )

                )

            [3] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/classes/Elgg/PluginHooksService.php
                    [line] => 38
                    [function] => call_user_func_array
                    [args] => Array
                        (
                            [0] => _elgg_notifications_cron
                            [1] => Array
                                (
                                    [0] => cron
                                    [1] => minute
                                    [2] => 
                                    [3] => Array
                                        (
                                            [time] => 1472670002
                                        )

                                )

                        )

                )

            [4] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/lib/elgglib.php
                    [line] => 815
                    [function] => trigger
                    [class] => Elgg\PluginHooksService
                    [type] => ->
                    [args] => Array
                        (
                            [0] => cron
                            [1] => minute
                            [2] => Array
                                (
                                    [time] => 1472670002
                                )

                            [3] => 
                        )

                )

            [5] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/lib/cron.php
                    [line] => 122
                    [function] => elgg_trigger_plugin_hook
                    [args] => Array
                        (
                            [0] => cron
                            [1] => minute
                            [2] => Array
                                (
                                    [time] => 1472670002
                                )

                            [3] => 
                        )

                )

            [6] => Array
                (
                    [function] => _elgg_cron_page_handler
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [0] => minute
                                )

                            [1] => cron
                        )

                )

            [7] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/classes/Elgg/Router.php
                    [line] => 95
                    [function] => call_user_func
                    [args] => Array
                        (
                            [0] => _elgg_cron_page_handler
                            [1] => Array
                                (
                                    [0] => minute
                                )

                            [2] => cron
                        )

                )

            [8] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/classes/Elgg/Application.php
                    [line] => 428
                    [function] => route
                    [class] => Elgg\Router
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Elgg\Http\Request Object
                                (
                                    [attributes] => Symfony\Component\HttpFoundation\ParameterBag Object
                                        (
                                            [parameters:protected] => Array
                                                (
                                                )

                                        )

                                    [request] => Symfony\Component\HttpFoundation\ParameterBag Object
                                        (
                                            [parameters:protected] => Array
                                                (
                                                )

                                        )

                                    [query] => Symfony\Component\HttpFoundation\ParameterBag Object
                                        (
                                            [parameters:protected] => Array
                                                (
                                                    [__elgg_uri] => /cron/minute
                                                )

                                        )

                                    [server] => Symfony\Component\HttpFoundation\ServerBag Object
                                        (
                                            [parameters:protected] => Array
                                                (
                                                    [USER] => nginx
                                                    [HOME] => /var/lib/nginx
                                                    [HTTP_CONNECTION] => Keep-Alive
                                                    [HTTP_HOST] => www.ureka.org
                                                    [HTTP_ACCEPT_ENCODING] => identity
                                                    [HTTP_ACCEPT] => */*
                                                    [HTTP_USER_AGENT] => Mozilla
                                                    [SCRIPT_FILENAME] => /mysite/index.php
                                                    [REDIRECT_STATUS] => 200
                                                    [SERVER_NAME] => www.mysite.org
                                                    [SERVER_PORT] => 443
                                                    [SERVER_ADDR] => 185.53.130.22
                                                    [REMOTE_PORT] => 52327
                                                    [REMOTE_ADDR] => 185.53.130.22
                                                    [SERVER_SOFTWARE] => nginx/1.10.1
                                                    [GATEWAY_INTERFACE] => CGI/1.1
                                                    [HTTPS] => on
                                                    [SERVER_PROTOCOL] => HTTP/1.1
                                                    [DOCUMENT_ROOT] => /mysite
                                                    [DOCUMENT_URI] => /cron/minute/
                                                    [REQUEST_URI] => /cron/minute/
                                                    [SCRIPT_NAME] => /index.php
                                                    [CONTENT_LENGTH] => 
                                                    [CONTENT_TYPE] => 
                                                    [REQUEST_METHOD] => HEAD
                                                    [QUERY_STRING] => __elgg_uri=/cron/minute/&
                                                    [FCGI_ROLE] => RESPONDER
                                                    [PHP_SELF] => /index.php
                                                    [REQUEST_TIME_FLOAT] => 1472670002.562
                                                    [REQUEST_TIME] => 1472670002
                                                )

                                        )

                                    [files] => Symfony\Component\HttpFoundation\FileBag Object
                                        (
                                            [parameters:protected] => Array
                                                (
                                                )

                                        )

                                    [cookies] => Symfony\Component\HttpFoundation\ParameterBag Object
                                        (
                                            [parameters:protected] => Array
                                                (
                                                )

                                        )

                                    [headers] => Symfony\Component\HttpFoundation\HeaderBag Object
                                        (
                                            [headers:protected] => Array
                                                (
                                                    [connection] => Array
                                                        (
                                                            [0] => Keep-Alive
                                                        )

                                                    [host] => Array
                                                        (
                                                            [0] => www.mysite.org
                                                        )

                                                    [accept-encoding] => Array
                                                        (
                                                            [0] => identity
                                                        )

                                                    [accept] => Array
                                                        (
                                                            [0] => */*
                                                        )

                                                    [user-agent] => Array
                                                        (
                                                            [0] => Mozilla
                                                        )

                                                    [content-length] => Array
                                                        (
                                                            [0] => 
                                                        )

                                                    [content-type] => Array
                                                        (
                                                            [0] => 
                                                        )

                                                )

                                            [cacheControl:protected] => Array
                                                (
                                                )

                                        )

                                    [content:protected] => 
                                    [languages:protected] => 
                                    [charsets:protected] => 
                                    [encodings:protected] => 
                                    [acceptableContentTypes:protected] => 
                                    [pathInfo:protected] => 
                                    [requestUri:protected] => /cron/minute/
                                    [baseUrl:protected] => 
                                    [basePath:protected] => 
                                    [method:protected] => 
                                    [format:protected] => 
                                    [session:protected] => 
                                    [locale:protected] => 
                                    [defaultLocale:protected] => en
                                )

                        )

                )

            [9] => Array
                (
                    [file] => /mysite/vendor/elgg/elgg/engine/classes/Elgg/Application.php
                    [line] => 371
                    [function] => run
                    [class] => Elgg\Application
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [10] => Array
                (
                    [file] => /mysite/index.php
                    [line] => 8
                    [function] => index
                    [class] => Elgg\Application
                    [type] => ::
                    [args] => Array
                        (
                        )

                )

        )

    [previous:Error:private] => 
)

Note for members who don't follow tags

Would it be helpful to show the tab "tags" to those members who still not follow any tags, and show the user some hints? For example "You do not follow any tags. To follow tags, click on the [] icon of any tag on the site. You can manage your tags in your settings."

'page_top' notifications not sent if 'search_advanced' plugin is activated

There is a conflict between 'tag_tools' and 'search_advanced' plugins:

In tag_tools_get_notification_type_subtypes(), get_registered_entity_types() is called but in search_advanced_init(), elgg_unregister_entity_type('object', 'page_top'); is called...

Until a proper fix is implemented in tag_tools or search_advanced plugin, a workaround could be implemented in tag_tools_init() by registering for 'notification_type_subtype' hook:

function tag_tools_init() {
...
elgg_register_plugin_hook_handler('notification_type_subtype', 'tag_tools', 'tag_tools_add_page_top_subtype_in_notifications');
...
}

function tag_tools_add_page_top_subtype_in_notifications($hook, $type, $return_value, $params) {
	if (empty($return_value) || !is_array($return_value)) {
	    return;
	}

	if (!elgg_is_active_plugin('pages')) {
	    return;
	}

	if( in_array('page_top', $return_value['object'])) {
	    return;
	}

	$return_value['object'][] = 'page_top';

	return $return_value;
}

strange bug: the word 'congestion' is not acceptable as a tag

i was just adding the word 'congestion' as a tag to a video on my site and found that no matter what i do, the system will not convert the word into a boxed tag. i can get a tag that contains every letter up to the word 'congestion' (e.g. 'congest' or 'congestio'), but not 'congestion'!

Russian keyboard

English key "," = Russian key "Б".
Pressing the "Б" tag added. That is, can not use the "Б" button.

Overload font-size style in tag view => all tags have the same size in the tag cloud

Overload font-size style in tag view => all tags have the same size in the tag cloud

Potential fix in tag tools v1.1.1 at line 37 of file: views/default/output/tag.php

-echo elgg_view('output/url', [
+$params = array(
    'href' => $url,
    'text' => $value,
    'encode_text' => true,
    'rel' => 'tag',
-]);
+        );
+
+$style = elgg_extract('style', $vars);
+if (!empty($style)) {
+    $params = $params + ['style' => $style];
+}
+
+echo elgg_view('output/url', $params);

Drag-and-drop re-ordering

The tag boxes can't be dragged for re-ordering (in elgg 1.9.4). This is needed if an user wants their tags to be in a specific order, for whatever reason. Now they need to delete every tag first if they want to add a tag in the beginning.

Tag Tools does not allows to run daily cron

I get the following error for daily cron but if i disable Tag Tools i don't have the problem.

Secondary loader failed to return row for 298719

        IncompleteEntityException Object
(
    [message:protected] => Secondary loader failed to return row for 298719
    [string:Exception:private] => exception 'IncompleteEntityException' with message 'Secondary loader failed to return row for 298719' in /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/AttributeLoader.php:235
Stack trace:
#0 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggObject.php(103): Elgg\AttributeLoader->getRequiredAttributes(Object(stdClass))
#1 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggObject.php(74): ElggObject->load(Object(stdClass))
#2 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Database/EntityTable.php(276): ElggObject->__construct(Object(stdClass))
#3 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Database/EntityTable.php(347): Elgg\Database\EntityTable->rowToElggStar(Object(stdClass))
#4 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/lib/entities.php(205): Elgg\Database\EntityTable->get('298719')
#5 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggExtender.php(164): get_entity('298719')
#6 /home/websiteplatfrom/public_html/mod/tag_tools/classes/ColdTrick/TagTools/Rules.php(45): ElggExtender->getEntity()
#7 [internal function]: ColdTrick\TagTools\Rules::applyRules('create', 'metadata', Object(ElggMetadata))
#8 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/EventsService.php(113): call_user_func_array('\\ColdTrick\\TagT...', Array)
#9 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Database/MetadataTable.php(188): Elgg\EventsService->trigger('create', 'metadata', Object(ElggMetadata))
#10 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php(448): Elgg\Database\MetadataTable->create(298719, 'tags', 'movies', '', 8316, 2, true)
#11 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php(223): ElggEntity->setMetadata('tags', Array)
#12 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php(1586): ElggEntity->__set('tags', Array)
#13 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggObject.php(120): ElggEntity->create()
#14 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php(1452): ElggObject->create()
#15 /home/websiteplatfrom/public_html/mod/rssimport/classes/AU/RSSImport/RSSImport.php(554): ElggEntity->save()
#16 /home/websiteplatfrom/public_html/mod/rssimport/classes/AU/RSSImport/RSSImport.php(217): AU\RSSImport\RSSImport->importBlog(Object(SimplePie_Item))
#17 /home/websiteplatfrom/public_html/mod/rssimport/lib/functions.php(115): AU\RSSImport\RSSImport->importItem(Object(SimplePie_Item))
#18 /home/websiteplatfrom/public_html/mod/rssimport/lib/hooks.php(29): AU\RSSImport\cron_import('daily')
#19 [internal function]: AU\RSSImport\daily_cron('cron', 'daily', '', Array)
#20 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/PluginHooksService.php(52): call_user_func_array('AU\\RSSImport\\da...', Array)
#21 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/lib/elgglib.php(827): Elgg\PluginHooksService->trigger('cron', 'daily', Array, '')
#22 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/lib/cron.php(133): elgg_trigger_plugin_hook('cron', 'daily', Array, '')
#23 [internal function]: _elgg_cron_page_handler(Array, 'cron')
#24 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Router.php(100): call_user_func('_elgg_cron_page...', Array, 'cron')
#25 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Application.php(436): Elgg\Router->route(Object(Elgg\Http\Request))
#26 /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Application.php(384): Elgg\Application->run()
#27 /home/websiteplatfrom/public_html/index.php(8): Elgg\Application::index()
#28 {main}
    [code:protected] => 0
    [file:protected] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/AttributeLoader.php
    [line:protected] => 235
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggObject.php
                    [line] => 103
                    [function] => getRequiredAttributes
                    [class] => Elgg\AttributeLoader
                    [type] => ->
                    [args] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [guid] => 298719
                                    [type] => object
                                    [subtype] => 4
                                    [owner_guid] => 8316
                                    [site_guid] => 1
                                    [container_guid] => 8316
                                    [access_id] => 2
                                    [time_created] => 1507897922
                                    [time_updated] => 1507897922
                                    [last_action] => 1507897922
                                    [enabled] => yes
                                )

                        )

                )

            [1] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggObject.php
                    [line] => 74
                    [function] => load
                    [class] => ElggObject
                    [type] => ->
                    [args] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [guid] => 298719
                                    [type] => object
                                    [subtype] => 4
                                    [owner_guid] => 8316
                                    [site_guid] => 1
                                    [container_guid] => 8316
                                    [access_id] => 2
                                    [time_created] => 1507897922
                                    [time_updated] => 1507897922
                                    [last_action] => 1507897922
                                    [enabled] => yes
                                )

                        )

                )

            [2] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Database/EntityTable.php
                    [line] => 276
                    [function] => __construct
                    [class] => ElggObject
                    [type] => ->
                    [args] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [guid] => 298719
                                    [type] => object
                                    [subtype] => 4
                                    [owner_guid] => 8316
                                    [site_guid] => 1
                                    [container_guid] => 8316
                                    [access_id] => 2
                                    [time_created] => 1507897922
                                    [time_updated] => 1507897922
                                    [last_action] => 1507897922
                                    [enabled] => yes
                                )

                        )

                )

            [3] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Database/EntityTable.php
                    [line] => 347
                    [function] => rowToElggStar
                    [class] => Elgg\Database\EntityTable
                    [type] => ->
                    [args] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [guid] => 298719
                                    [type] => object
                                    [subtype] => 4
                                    [owner_guid] => 8316
                                    [site_guid] => 1
                                    [container_guid] => 8316
                                    [access_id] => 2
                                    [time_created] => 1507897922
                                    [time_updated] => 1507897922
                                    [last_action] => 1507897922
                                    [enabled] => yes
                                )

                        )

                )

            [4] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/lib/entities.php
                    [line] => 205
                    [function] => get
                    [class] => Elgg\Database\EntityTable
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 298719
                        )

                )

            [5] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggExtender.php
                    [line] => 164
                    [function] => get_entity
                    [args] => Array
                        (
                            [0] => 298719
                        )

                )

            [6] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/mod/tag_tools/classes/ColdTrick/TagTools/Rules.php
                    [line] => 45
                    [function] => getEntity
                    [class] => ElggExtender
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [7] => Array
                (
                    [function] => applyRules
                    [class] => ColdTrick\TagTools\Rules
                    [type] => ::
                    [args] => Array
                        (
                            [0] => create
                            [1] => metadata
                            [2] => ElggMetadata Object
                                (
                                    [attributes:protected] => Array
                                        (
                                            [time_created] => 1507897922
                                            [type] => metadata
                                            [id] => 2534861
                                            [entity_guid] => 298719
                                            [owner_guid] => 8316
                                            [access_id] => 2
                                            [enabled] => yes
                                            [name_id] => 60
                                            [value_id] => 61992
                                            [value_type] => text
                                            [name] => tags
                                            [value] => movies
                                        )

                                    [valid:protected] =>
                                    [time:ElggData:private] =>
                                )

                        )

                )

            [8] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/EventsService.php
                    [line] => 113
                    [function] => call_user_func_array
                    [args] => Array
                        (
                            [0] => \ColdTrick\TagTools\Rules::applyRules
                            [1] => Array
                                (
                                    [0] => create
                                    [1] => metadata
                                    [2] => ElggMetadata Object
                                        (
                                            [attributes:protected] => Array
                                                (
                                                    [time_created] => 1507897922
                                                    [type] => metadata
                                                    [id] => 2534861
                                                    [entity_guid] => 298719
                                                    [owner_guid] => 8316
                                                    [access_id] => 2
                                                    [enabled] => yes
                                                    [name_id] => 60
                                                    [value_id] => 61992
                                                    [value_type] => text
                                                    [name] => tags
                                                    [value] => movies
                                                )

                                            [valid:protected] =>
                                            [time:ElggData:private] =>
                                        )

                                )

                        )

                )

            [9] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/Elgg/Database/MetadataTable.php
                    [line] => 188
                    [function] => trigger
                    [class] => Elgg\EventsService
                    [type] => ->
                    [args] => Array
                        (
                            [0] => create
                            [1] => metadata
                            [2] => ElggMetadata Object
                                (
                                    [attributes:protected] => Array
                                        (
                                            [time_created] => 1507897922
                                            [type] => metadata
                                            [id] => 2534861
                                            [entity_guid] => 298719
                                            [owner_guid] => 8316
                                            [access_id] => 2
                                            [enabled] => yes
                                            [name_id] => 60
                                            [value_id] => 61992
                                            [value_type] => text
                                            [name] => tags
                                            [value] => movies
                                        )

                                    [valid:protected] =>
                                    [time:ElggData:private] =>
                                )

                        )

                )

            [10] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php
                    [line] => 448
                    [function] => create
                    [class] => Elgg\Database\MetadataTable
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 298719
                            [1] => tags
                            [2] => movies
                            [3] =>
                            [4] => 8316
                            [5] => 2
                            [6] => 1
                        )

                )

            [11] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php
                    [line] => 223
                    [function] => setMetadata
                    [class] => ElggEntity
                    [type] => ->
                    [args] => Array
                        (
                            [0] => tags
                            [1] => Array
                                (
                                    [0] => movies
                                    [1] => movie review
                                )

                        )

                )

            [12] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php
                    [line] => 1586
                    [function] => __set
                    [class] => ElggEntity
                    [type] => ->
                    [args] => Array
                        (
                            [0] => tags
                            [1] => Array
                                (
                                    [0] => movies
                                    [1] => movie review
                                )

                        )

                )

            [13] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggObject.php
                    [line] => 120
                    [function] => create
                    [class] => ElggEntity
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [14] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/vendor/elgg/elgg/engine/classes/ElggEntity.php
                    [line] => 1452
                    [function] => create
                    [class] => ElggObject
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [15] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/mod/rssimport/classes/AU/RSSImport/RSSImport.php
                    [line] => 554
                    [function] => save
                    [class] => ElggEntity
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [16] => Array
                (
                    [file] => /home/websiteplatfrom/public_html/mod/rssimport/classes/AU/RSSImport/RSSImport.php
                    [line] => 217
                    [function] => importBlog
                    [class] => AU\RSSImport\RSSImport
                    [type] => ->
                    [args] => Array
                        (
                            [0] => SimplePie_Item Object
                                (
                                    [feed] => SimplePie Object
                                        (
                                            [data] => Array
                                                (
                                                    [child] => Array
                                                        (
                                                            [http://www.w3.org/2005/Atom] => Array
                                                                (
                                                                    [feed] => Array
                                                                        (
                                                                            [0] => Array
                                                                                (
                                                                                    [data] =>

Profile manager tag fields not taken into account in tags suggestion (autocomplete)

Title: Profile manager tag fields not taken into account in tags suggestion (autocomplete)
Context: elgg v1.12.9 + profile manager v9.1 + tag tools v1.4 + other 3dr party plugins
Scenario:

  1. In profile manager settings, create a new user profile field "area of interest"
  2. Set "area of interest" field type as "tags"
  3. Edit a user profile page, add "movies" in "area of interest" field
  4. Edit another user profile page, in the "area of interest" field, enter "mo"
    => the "movies" tag is not suggested

Same issue with group profile tag fields

Possible workaround in procedures/autocomplete.php by adding $profile_area_of_interest_id in the WHERE condition of the SQL request

<?php

elgg_gatekeeper();

$query = get_input('q');

$result = [];

if (!empty($query)) {

    $dbprefix = elgg_get_config('dbprefix');
    $tags_id = elgg_get_metastring_id('tags');
    $profile_area_of_interest_id = elgg_get_metastring_id("profile_area_of_interest");

    $sql = "SELECT msv.string as string, count(*) as total";
    $sql .= " FROM {$dbprefix}metadata md";
    $sql .= " JOIN {$dbprefix}metastrings msv ON md.value_id = msv.id";
    $sql .= " WHERE (md.name_id = " . $tags_id . " OR  md.name_id = " . $profile_area_of_interest_id.")";
    $sql .= " AND msv.string LIKE '" . sanitise_string($query) . "%'";

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.