What is the purpose of the CTools requirement exactly? This seems like overkill to me, surely it's not needed.

Comments

markcarver created an issue. See original summary.

deciphered’s picture

Status: Active » Fixed

CTools is a requirement as it's a requirement of Entity Reference, which is a requirement of the Entity Mention type plugin.

The Entity Mention type plugin adds a Entity Reference field to the Mention entity for the sake of storing the mentioned entity as a Entity reference that can be used to create a relationship in Views, or any other purpose.

Ideally the dependency on Entity Reference would be removed in the future, but without it there would be no Mention Types currently available and as such the module wouldn't be usable out of the box.

While I could use a custom property or custom field and a custom views handler to get the same functionality, I'd prefer not to re-invent the wheel, and given that CTools is a requirement of Views I don't see it being an issue for the majority of users.

markhalliwell’s picture

Title: CTools requirement » Create mentions_ui sub-module
Status: Fixed » Active

The entity_type entity seems a bit overkill IMO. All the mention entity needs are custom entity_type, entity_id and entity_bundle properties, which are really the crux of any kind of entity referencing. We don't really need the entity_reference module to do that and it just adds yet another level of complexity out of the box.

For the views/ctools UI stuff, that should really go in a separate mentions_ui sub-module as we had originally discussed (which is where this ctools dependency/plugin can be added).

deciphered’s picture

That's on the assumption that a mention is from and too an entity. It occurs to me that a mention does not have to be to/from an entity, especially given one of the use-cases you personally made for the module; Mentioning an API function/page.

There is not CTools UI stuff in the 7.x-2.x branch, it is now completely Entity API based, and there are no default Views at this stage, just Views integration provided by the Entity API module and improved via a hook_views_data_alter() function. Views is not a requirement.

I'm open to removing the dependency on Entity Reference (and as such, CTools), and there is already a @TODO to that extent, but it would have to be done in such a way that getting the Entity relationship in the View is easy, as IMO it is most likely going to be one of the most commonly used features.

deciphered’s picture

Title: Create mentions_ui sub-module » CTools requirement
Status: Active » Fixed

Regarding the CTools requirement; more correct than my previous response, Mentions Types plugins are CTools plugins, so the dependency is essential. I have removed the dependency on Entity Reference, rather opting to provide a textual warning if it's not available as it will reduce the functionality of the Entity Mention type.

There is no Mentions UI specific stuff, as that as all provided by the Entity module which is a requirement for backend functionality.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.