9

It appears that when one or more Entries (or other types of content) are manipulated (in my case, deleted) from the bulk edit view in the Control Panel, the type of events that are triggered are Element events, rather than Entry events. If you refer to the Craft documentation on elements.onPerformAction, you can see that the 2 params you get access to are ...


3

You need to include your module handle to the route module-handle/site/say You also should use the correct namespace instead of app/controllers I suggest you to read the documentation You can as well define a route if you like


3

Here is one approach: Whenever an asset is checked on or off, it triggers a manipulation of the hidden ul.menu. You could listen for that update to be complete, then you’ll be able to access and hide the link. $('#main .elements:first').on('click', '.checkbox', function(evt) { // "View Asset" action is visible by default var isViewActionVisible = ...


2

I think your issue may be that the ElementsService getAction method expects the full classname for your custom ElementAction (sans the "ElementAction" suffix), i.e. $customAction = craft()->elements->getAction('PluginName_Custom');


2

So it seems what I was doing wrong was passing in a single $artistId rather than an array. With the change shown below it works as expected: foreach ($assets as $asset) { $artistFieldModel = craft()->fields->getFieldByHandle('artist'); craft()->relations->saveRelations($artistFieldModel, $asset, [$artistId]); }


1

In Craft 3 the csrf token validation in the general.php config is set to true by default. In order to request your controller with post requests you have to turn it off or include the token https://docs.craftcms.com/v3/changes-in-craft-3.html#csrf-token-params {% set csrfTokenName = craft.app.config.general.csrfTokenName %} {% set csrfToken = ...


1

There's a 99% chance you're running into a case-sensitivity issue on your file system. Check your plugin's name, the handle and the action URL for the controller you're trying to hit. Most likely locally, you've got a case insensitive file system, so it doesn't matter that pluGiNHanDlE is not equal to pluginHandle, but on staging it's case sensitive so it ...


1

I know this is a late reply. I hope it will help others. You need to return false; so that the background color is red. Example: if (count($criteria->ids()) > 1) { $this->setMessage($this->getParams()->warningMessage); return false; }


1

I'd recommend to follow the guide in the docs. https://craftcms.com/docs/plugins/element-actions Update: There's a dedicated section about "Adding actions to index pages". If your Element Action is intended for your own custom Element Type, you can do that by implementing the getAvailableActions() method on your Element Type class. The link takes you to ...


Only top voted, non community-wiki answers of a minimum length are eligible