Reviewed & tested by the community
Project:
Multifield
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2013 at 17:06 UTC
Updated:
20 Mar 2017 at 10:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damienmckennaProblem #1: It doesn't automatically add all of the multfield's fields when a multifield is added to a feature. It should.
Comment #2
damienmckennaProblem #2:
When loading a feature that has a multifield exported in it and attempting to get the new fields to load, i.e. deploying the new multifield, the following error is reported:
Comment #3
steinmb commentedAnyone looked into what we actually are missing in the feature export? #2 indicate at least the field type is empty or the field.info is never exported.
Comment #4
attiks commentedFYI: http://drupalcode.org/project/multifield.git/commit/4e7a90e removed necessary info for features, no idea why
Comment #5
jelle_sHere is a working patch (tested by creating a feature and enabling it on a fresh drupal install).
As @attiks said, I had to add the ctools exportable info that was removed from multifield_schema in order to get features to work.
With this patch dependencies and subfields are auto-detected.
For example:
Add a multifield to a content type.
Create a new feature and select the content type with the multifield.
The features will auto-detect & auto-select the multifield with its subfields to be exported with this feature.
Comment #6
jelle_s*sigh*
This time without the newline error.
Comment #7
jelle_sSeems there is still a problem.
The fields & instances exist, but are not shown on the edit form
Comment #8
jelle_sStrange, now I can't reproduce my own error.
Everything seems to work as expected now.
Comment #9
dave reidI removed the exportable hooks because it was clear there was a lot more needed to actually make Features integration work. So I'd rather remove it than encourage people to export their multifields and have it not work. Once this is ready I'll consider it to be re-added. I'll take a look.
Comment #10
jelle_sNew patch: Fixes the case where the multifield config object was not yet loaded in the ctools cache and features attempted to create the multifield field base anyway, which resulted in a FieldException.
Comment #11
jelle_sOk there was one last problem that if the multifield existed but had no subfields yet (meaning the field type does not exist), a FieldException would be thrown. New patch attached.
Comment #13
jelle_sSorry, the previous patch didn't include the multifield.features.inc file. New patch attached.
Comment #14
Crell commentedComment #15
attiks commentedAFAIK this is RTBC ;-)
Comment #16
mwesthof commentedFYI: Patch in #13 + latest 7.x-1.x code works for me.
Multifields are exported and imported as expected.
Comment #17
realityloop commented+1 this fixes features integration.. RTBCComment #18
realityloop commentedInformation is captured but multifield not added to it's content type on a site install, you need to revert feature after the site install for the multifield field to be on it's content type.
Comment #19
attiks commented#18 Isn't this a more general feature problem?
Comment #20
steinmb commentedA site install should come out clean without the need of a revert. That is in my world though :)
Comment #21
attiks commentedIn my world as welk, but features is some times a different universe
Comment #22
dave reidRelated, with #2234769: Should multifield types be represented as separate field types, or just one 'Multifield' field type? and the new 'Multifield' field type, it becomes *way* easier to export a multifield to features since it works more like the Field Collection way: the 'bundles' of multifields are all the field names that have
$field['type'] = 'multifield';. I'm half tempted to officially deprecate the old field types since this seems to work sooooooo much better.Comment #23
attiks commentedDeprecating the old one sounds reasonable, but will you provide an upgrade?
Comment #24
dave reidI'm not sure it will be possible to provide an upgrade path, especially since the module is in an unstable state and we would have to mess with people's existing fields too much. Right now deprecating means 'you cannot create new field instances of those field types'
Comment #25
attiks commentedMakes sense
Comment #26
attiks commented@Dave I assume we go with the new field types? Just asking because we are about to launch a site depending heavily on multifield, so we rather switch now?
Comment #27
becw commentedHas any work from this issue been committed? I'm having some issues with features on the latest -dev and I'm wondering if they're related to this work:
features[ctools][] = multifield::in the feature's .info fileI know that -unstable implies there might not be an upgrade path, but I'm trying to figure out where exactly my issues are coming from before trying to fix the 16 multifields on my site.
Comment #28
becw commentedIt looks like my issues are caused by #2234769: Should multifield types be represented as separate field types, or just one 'Multifield' field type?, but they definitely relate to features exports.
Comment #29
justafishThis patch will prevent a feature from showing as overridden, but shouldn't break when subfields haven't been created yet e.g. on a site installation.
Note that I only exported using the native field exports and ignored the "Multifield" option, which I think is going to be removed (see #2355777: Multifield is trying to export [feature-name]..inc ).
Comment #31
ciss commentedRerolled against 7.x-1.x. Notable conflicts happend in multified.features.inc and are listed below.
In multifield_field_default_field_bases_alter():
7.x-1.x:
Patch (picked):
In multifield_features_pipe_field_base_alter():
7.x-1.x (picked):
Patch:
In both cases I had to make a guess as to what might integrate better.
Comment #32
ciss commentedPatch caused Strongarm components that where unrelated to multifield to not get exported, even though they had been added via the features UI. Can't dig deeper for now.
Adding a minor portion of the patch that fixes notices regarding missing current_version / api keys, and that should also fix incomplete files names ("..inc"). Clear your cache after applying.
Comment #33
likewhoa commented@ciss your last patch fails because the code was already included in the previous patch, perhaps you didn't clear cached.
Comment #34
mustanggb commentedFeatures has been working since #2234769: Should multifield types be represented as separate field types, or just one 'Multifield' field type? was committed.
#32 fixes the undesirable notices that pollute the log messages, I think this is all that's needed.
Comment #35
mustanggb commentedOkay multifield_field_default_field_bases_alter() is apparently needed to prevent errors if subfields don't exist, but if they do exist it will cause features to mark the multifields as overridden if though they aren't, so I think the empty arrays should only be added if there is nothing there already.
I used the below modifications in conjunction with #32.
Comment #36
ada hernandez commentedAdds the feedback from #35 into a patch.
Comment #39
heddnPatch in #32 is what we should use (if tests come back as a pass). The comments in #35 have to be fixed upstream in features. See #2506877: Remove 'indexes' from field base.
Marking #32 RTBC.
Comment #40
mustanggb commentedI concur with heddn, my suggestion worked for reverting but not creating features, now it works with both.
Comment #41
mustanggb commentedError with features integration #2451011: Recoverable fatal error: Argument 1 passed to multifield_extract_multifield_machine_name() must be of the type array, null given
Comment #42
osopolarPatch in #32 works well together with patch from #2506877: Remove 'indexes' from field base (for comment #35).
Comment #45
mustanggb commented#32 is RTBC
Comment #46
ademarco commented#32 works well here too.
Comment #47
dave reidI'm confused why we need the exportable definition here again. Is it to support the older multifields that are stored in the multifield table (and is no longer possible to create new ones)?
Comment #48
silverham commentedHi there,
I believe the reason is that the ctools standards say we should have a "exportable definition". See "Defining the configuration data":
https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to-make...
Additionally, It may stop the multifield fields from being exported/imported properly via features.
On my machine, if you navigate to a exported multifield inside a features in the features UI -> recreate, there are errors from features module:
So the change in #32 fixes this (if you create brand new feature)
Comment #49
jenlampton#32 is RTBC from me as well. Thanks for all the work on this!
Comment #50
RAWDESK commentedSubscribed to follow up applied #13 and #32 patch for CG
Thumbs up also !
Comment #51
RAWDESK commentedWe stepped out of multifield in favour for paragraphs module for the following reason :
Once multifield and its subfields are used in content, it seems impossible to change the display settings (eg. adding a grouping div field).
After disabling and uninstalling from our site, a lot of (via #50) created features were not cleaned up properly.
See attached screenshot from our gitlab commit where we manually removed the feature leftovers in code (inaccessible via Features UI) :
Notice the files that have the suffix ..inc (double dot) -> eg. feature.job.posting..inc
Looks like there's still some work to do.
Comment #52
RAWDESK commentedComment #53
RAWDESK commentedComment #54
RAWDESK commented