here is patch that add's generate entity create + edit support based upon the patch #1196456: provide a harmonized entity_form() function. Thus the entity API + that patch is required for this to work.

Attached patch implements two plugins, which seem to work fine. With the patch some plugins are duplicated now, like node-edit. Not sure how we should handle those. For now I've just prefixed the title of all entity-api plugins with "Entity API:", such that one can distinguish them in the UI.

For creation, I've just turned required entity-references into required contexts, as non-entity properties are usually filled via the form. Also, I included an option for choosing the bundle.

Please review this + the required entity API patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mh86’s picture

updated the patch which fixes following problems:
- assigning of context to the entity (got mixed-up with multiple contexts)
- marking fields with entity references as optional context, as otherwise it wouldn't be possible to let users select the values for a node reference, for example, any more. (The plugin property still is called 'required context', as when renaming it, the fields weren't rendered in the Page Manager any more)

mh86’s picture

fixes my last patch, which actually had problems assigning the context values and handling of optional context

EclipseGc’s picture

Assigned: Unassigned » EclipseGc
Status: Needs review » Postponed

I'm working really hard to get a final release of this out. The long and short of it is that I really like the idea of this plugin, but have some UI things I wanted to change before actually introducing context_admin child plugins... and they're super non-trivial so I'm pushing this, along with the UI changes I'm planning to 2.x.

ydnar79’s picture

First, I just want to state what a great module this is that you have contributed back to the community!

But I was just curious how things were progressing with adding the ability to create/edit generic entities through context admin? I see that back in October, it was stated that it would be included in a 2.x version of the module. However, I noticed that there have not been any commits since November and no hint of a 2.x branch.

Do you have any idea when the new version may be available? Or when this feature may be added to the current version?

This would be an amazing feature to have.... one that I believe MANY could use. I for one would LOVE to have it for a project that I am currently working on.

Any updates / information would be greatly appreciated!

Thanks again for all of the hard work!

EclipseGc’s picture

I've not branched 2.x at all yet, mostly because I'd been working to get 1.0 out and then had some other commitments I needed to get to. This is very much on my mind daily, so it will happen soonish, but there are just some personal projects that I need to give some priority to right now.

I don't have an exact time frame on this, and I am trying to keep up with the 1.x branch right now, there are a handful of things that need to be fixed that have come to light, but in general I share excitement about trying to get this feature working in 2.x. It would simplify a bunch of stuff and provide a lot of additional abilities while simultaneously providing a framework for killing about a bajillion contrib module (like auto_nodereference for example).

So this will happen, and probably pretty soonish, but I'm still dealing with some other obligations.

Eclipse

ydnar79’s picture

Thank you VERY much for such a fast response. Trust me, I know what it is like to have a bunch of different things going on all at once. I look forward to future updates and seeing where this module goes!

I will keep an eye on this module and will try to assist wherever I am able to do so....

Thanks again for the fast update!

mh86’s picture

Although it's postponed for 2.x branch, I re-rolled the patch for the current 1.x-dev version.
Some of the code is still a bit experimental, but people can use it and try if it works for their use case.

mh86’s picture

And here is another version. The previous patches combined all possible contexts in the required context setting, although some are optional (e.g. the node author is required, whereas an entity reference field on the node is optional). The big disadvantage of the required context setting is that ctools keys them with a numerical key, and as new entity reference fields can be added to the entity, the keys might change, which might break the configuration.
So the new patch separates the fields into an optional context setting that is keyed by the property name. The required context setting is still numerically keyed, but that information shouldn't change anyway.