We have moved to Github. Please open tickets there.

Opened 17 months ago

Closed 16 months ago

Last modified 16 months ago

#4272 closed Defect (fixed)

Single location for entity type list definition

Reported by: mrclay Owned by:
Priority: normal Milestone: Elgg 1.8.4
Component: Core Version: 1.8.2
Severity: minor Keywords:
Cc: brett@… Difficulty:

Description

Currently the mapping of entity types to classnames is hardcoded:
https://github.com/Elgg/Elgg/blob/1.8/engine/lib/entities.php#L631
https://github.com/Elgg/Elgg/blob/1.8/engine/lib/entities.php#L964
https://github.com/Elgg/Elgg/blob/1.8/engine/lib/entities.php#L1552
(and probably more)

While entity types are rarely added (and shouldn't generally be by plugins), I need it for my plugin :)
https://github.com/mrclay/Elgg-xcollection
I had to fork get_entity(as_row) and delete_entity to workaround this, but I'd have to fork a lot more to support metadata, etc.

In the short run I may have to rewrite this as an ElggObject, though this would add more work porting it back into core later.

Change History (5)

comment:1 Changed 17 months ago by mrclay

  • Resolution set to wontfix
  • Status changed from new to closed

I've recoded my plugin as an ElggObject so I've personally no immediate need for this. Further I don't think it's wise to enable this by plugin devs (e.g. would we have to give devs the ability to alter the entities.type ENUM?); using objects is probably a "good enough" way to model future potential entities.

comment:2 Changed 17 months ago by cash

  • Milestone changed from Needs Review to Elgg 1.8.3
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Summary changed from Need way to add entity types at runtime to Single location for entity type list definition
  • Type changed from Feature Request to Defect

I left a comment on http://community.elgg.org/pg/forum/topic/830706/entity-list-spec/

Independent of your work, it makes sense to put all the entity types in a central place.

comment:3 Changed 17 months ago by cash

  • Milestone changed from Elgg 1.8.3 to Elgg 1.8.4
  • Status changed from reopened to new

comment:4 Changed 16 months ago by Cash Costello

  • Resolution set to fixed
  • Status changed from new to closed

Fixes #4272 where an array of entity types can be used, use array in config object

Changeset: 5a3390fbb42a787f7c2ba4f13b6a6843d9a90c7b

comment:5 Changed 16 months ago by Cash Costello

Fixes #4272 where an array of entity types can be used, use array in config object

Changeset: 5a3390fbb42a787f7c2ba4f13b6a6843d9a90c7b

Note: See TracTickets for help on using tickets.