We gave Spark a look-see for a recent project, but we were using Field Collections (and nested Field Collections too) and Spark wasn't doing it's in-place magic.

I imagine this is pretty tricky due to the way Field Collections works, but it'd be a noble cause to get some integration with it. It's an extremely powerful module and in my opinion, one of the major shortcomings of Drupal before FC arrived on the scene.

CommentFileSizeAuthor
#5 Screen Shot 2013-04-05 at 14.18.39.png200.12 KBWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Title: Spark + Field Collections » Edit + Field Collections
Project: Spark » Edit
Version: 7.x-1.0-alpha6 » 7.x-1.x-dev

Pretty sure this is about the inline editing feature specifically.

Wim Leers’s picture

According to http://drupal.org/project/field_collection:

A field collection is internally represented as an entity, which is embedded in the host entity. Thus, if desired field collections may be viewed and edited separately too.

This is some kind of "pseudo" or "virtual" entity, then? It sounds like the data modeling here is off.

In any case, Edit is now built on top of http://createjs.org. Once we get JSON-LD support in Drupal 8 (and Field Collections are also supported), and as long as the content can be annotated (semantically) correctly through RDFa, then it should be possible to make this work. Create has explicit support for collections: http://bergie.iki.fi/blog/create-collections/, http://createjs.org/guide/#collections.

If that turns out to be impossible to map clearly, then it might still be possible to add support for this thanks to the fact that Edit ships with its own "drupalFormWidget"; IOW, if Field Collections is implemented "correctly" from a Field API point of view, meaning that it is "just another field", then it should work: it'd retrieve a form to edit the field collection field, and you'd be able to edit that in-place.

That being said, at least the nomenclature seems to indicate this is something that we should investigate whether this maps cleanly to the semweb "collections" concept, in which case Create.js could be of great help.

I apologize for the vagueness of the answer, but the description on the Field Collections project page is not very encouraging, it sounds like it's implemented kludgily, which is quite possibly the only way to implement it at all in today's Field API. If it's too hacky, then it likely won't be easy to get it to work.

Wim Leers’s picture

Category: bug » feature
Priority: Normal » Minor

All of the semwebness in #2 can be forgotten, since this is a D7-only issue, where we won't have JSON-LD anyway (and in D8 we most likely won't either).

Now it really boils down to this:

if Field Collections is implemented "correctly" from a Field API point of view, meaning that it is "just another field", then it should work: it'd retrieve a form to edit the field collection field, and you'd be able to edit that in-place.

This is a rather edge-casey thing to support, so marking as a minor feature request.

Wim Leers’s picture

Assigned: Unassigned » Wim Leers
Status: Active » Fixed
Issue tags: +Spark

I started working on implementing this… and … I succeeded! :D

Field collection is a well-implemented module, which made this pretty easy :)

http://drupalcode.org/project/edit.git/commit/751ee1d

Wim Leers’s picture

I forgot to attach the pretty screenshot, which shows that the above commit makes Edit work both when you edit the full node with a field-collection field and when you edit the field collection entity directly.
Screen Shot 2013-04-05 at 14.18.39.png

Status: Fixed » Closed (fixed)

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

molnitza’s picture

Status: Closed (fixed) » Needs work

I think the problem is not completely solved. In a custom view it is not possible to use edit for field-collection fields.

Wim Leers’s picture

Status: Needs work » Closed (fixed)

Can you please create a follow-up issue, with more detailed info, and especially steps to reproduce? Thanks :)