I'd like to use this module on my entities now it looks like it's only working with nodes.

CommentFileSizeAuthor
#1 2193243-fix-entities-support.patch14.18 KBDavideBru
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DavideBru’s picture

Version: 7.x-4.5 » 7.x-4.x-dev
Status: Active » Needs review
Issue tags: +entity
FileSize
14.18 KB

Issue solved by making some minor changes to the module:
1. replaced hook_node_view() with a more appropriate hook
2. applied some changes to addtoany_admin_settings() configuration form, the section 'Placement' has been renamed in ‘Display’, and modified to including the ability to configure view details of entities available in the environment.
3. updated addtoany_create_node_buttons() function with a more generic addtoany_create_entity_buttons().

These changes allows you to configure the social link buttons provided by AddToAny display to all the available entities, and not exclusively for content types as before.

It's possible to select bundles and view modes of the entities to associate with links, and as before you can also define entity sections (link and content) where the link should be subsequently rendered.

@TODO: It would be wise in my point of view to change the logic with which the configurations are saved (currently each element of the form, and for each entity a variable is associated, cause of system_setting_form()) serializing configuration data and saving the serialized object in a variable.

The changes are in the attached patch, please review the code and notify me to the email address associated with my profile for any information and / or doubt.

sjpagan’s picture

Status: Needs review » Reviewed & tested by the community

this patch worked for me.

jrochate’s picture

Didn't work for me.

patch install with success, admin interface show all the entities, but after configuring Node -> Bundle, there is no AddtoAny display nor AddtoAny field available on manage display.

VladimirAus’s picture

Status: Reviewed & tested by the community » Fixed

Committed! Thank you 🥤

micropat’s picture

Status: Fixed » Closed (won't fix)

Unfortunately reverted in the latest release.

The main issue with this change is that it removes the default buttons display on Article and Page content types.

We probably won't get to this issue before D7's EOL, but feel free to reopen for review if a patch is rolled that keeps the default settings like the 8.x and 2.0.x branches do.