Hi,
Further to this topic (http://forums.squizsuite.net/index.php?showtopic=8445), I’ve decided to try the ‘Execute Database Query’ action to achieve the desired result.
Currently my test trigger is set up to fire when a PDF, Word, PowerPoint or Excel file is created beneath my test standard page. In practice the root node would be our entire Intranet as people can upload files just about anywhere on the site.
The only action on this trigger is ‘Execute Database Query’.
The query is:
UPDATE sq_ast_lnk SET "value"='files' WHERE minorid LIKE '%asset_assetid%';
I should point out that I can successfully run this query in pgAdmin III.
Initially I used an existing DB Connector, but it turned out to be a read-only user so I got a permission denied error, as well as two trigger failure notices.
I replaced the DB connector with Database details, using my own username and password (as used in pgAdmin). I stopped getting the permission denied error but continued to get the two notices.
They are:
MySource Notice
File: [SYSTEM_ROOT]/core/include/locale_manager.inc
LINE: 547
Message: Trigger Action: trigger_action_execute_database_query Failed [CORE0135]
AND
MySource Warning
File: [SYSTEM_ROOT]/core/include/locale_manager.inc
Message: FAILURE: Trigger "Add link value to file assets for display purposes" (Trigger# 105), Event "trigger_event_asset_created" broadcast by "2010-Dec-08.pdf" (Id# 45746) [CORE0127]
I've also tried different events - Link created (same sort of notices); After Asset Built (didn't appear to do anything); and Asset Accessed (didn't appear to do anything).
I'm not sure if this is a bug, or if it's a problem with the trigger or the connection to the database. I'd really appreciate some advice on this one!
Thanks,
Margaret