backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 39 forks source link

[meta] Finish Entity API integration #49

Closed SebCorbin closed 10 years ago

SebCorbin commented 11 years ago

Backdrop was forked around the time that Entities were being converted into real objects (i.e. comment_save() now just wraps around $comment->save()), but the implementation is incomplete. We should finish the conversion to move entities to real objects to enable generic entity operations for such problems as #142.

Issues that need to be addressed (if backporting from D8) need to be handled in this order, as some earlier ones are required for the later ones:

davereid commented 11 years ago

The contrib entity API module is not the answer and has more learnability issues itself.

quicksketch commented 11 years ago

Yeah, agreed with @davereid, Entity API module itself takes the approach that all all entities are treated equally, leading to enormous amounts of bloat. The Entity system overall can be improved significantly, making entities easier to make fieldable for example (saving a module like FileEntity from doing it all manually), but we certainly can't just throw Entity API into core wholesale.

rudiedirkx commented 11 years ago

I'd very much like to 'fix' core entity. What it could do is create abstract helpers that can be used by other modules. If your contrib module creates 2 non-fieldable entity types that don't use tokens etc etc, don't use the helpers. Otherwise do. First #11.

alexweber commented 11 years ago

@rudiedirkx Agreed, and while we're at it, it couldn't hurt to makes Nodes, Comments, Users, Taxonomy proper objects eh?

rudiedirkx commented 11 years ago

True dat, but even first #41

quicksketch commented 10 years ago

Now that it's been a few months I'm coming back around to this issue because of #142. In D7, VBO module depended on Entity API module for saving arbitrary entities. As it turns out, the branch point of Backdrop (Feb 29, 2012), actually has resulted portions of Entity API already being in the project. It was added between these two drupal.org issues:

As @davereid noted above, D7 Entity API (which was in Backdrop from our branching), has really serious learnability and architectural issues. Fortunately, the approach used by D8 core (and Backdrop by association) is quite a bit better than the hacks the contrib project was forced to use. At this point, we have "proper" objects for Comments, but not for other entities. We'll need to convert at least nodes to be real objects in order to complete #142 for the basic node and comment use-cases.

quicksketch commented 10 years ago

I created sub-issues and updated the description for this to become the main "meta" issue. Looks like since comments are already converted, we have 4 followup issues for each of Node, User, File, and Taxonomy objects.

quicksketch commented 10 years ago

We've finished conversion of all the entity types in core. For starters, this issue is complete. We now have a consistent way of all CRUD for entities, as well as pulling out things like label, revision, id, etc. I've made a followup issue at https://github.com/backdrop/backdrop-issues/issues/164 to simplify down the entity objects.