I have a node type where a field_collection field is embedded. (Embed widget).
http://drupal.org/project/field_collection
This brings redirect to add not only a vertical tab for adding redirects to the node, it also adds a tab for adding redirects to the field collection. see Screenshot. I am not quite sure that this will produce problems but it makes not much sense to have an another add tab there as field collection is not meant to get displayed as stand alone content.
I tried to use the migrate support patch http://drupal.org/node/1116408#comment-4844614 #1116408: Support migrate module: Destination handler class and actually it is not working. No redirect is created for the migrated node. Maybe redirect or migrate has a problem to determine which is the right entity id where the redirect should point to because of the field_collection in this node.
I will investigate further an try another migration with a "normal" node and see if it is working there. If this is the case I will post a review to the patch at #1116408: Support migrate module: Destination handler class.
regards
marcus
Comments
Comment #1
marcusx CreditAttribution: marcusx commentedOk it is even worse. For each field collection item we will get a vertical tab. And the counter of how many redirects are existing is also wrong. See attached screenshot.
Comment #2
marcusx CreditAttribution: marcusx commentedThe enclosed patch adds an array with "activated entities" against we check if a redirect field should be attached to an entity. My suggestion is to add the population of this array to the admin interface. Or let the user add the redirect field manually to an entity.
'User' and 'Node' entities could still get the field and the vertical tab automatically for easier usage.
Comment #3
Dave ReidThis is the better way to support this. Please test the following patch and add 'redirect' => FALSE to field_collection_entity_info().
Comment #4
mstrelan CreditAttribution: mstrelan commentedThanks Dave, this works as expected, though instead of patching field_collection.module I altered it in my own custom module.
Comment #5
alanburke CreditAttribution: alanburke commentedI've applied that patch to redirect, and also implemented an alter as described above.
Patch works correctly.
Thanks.
Comment #6
mstrelan CreditAttribution: mstrelan commentedSounds like this is RTBC to me
Comment #7
droath CreditAttribution: droath commentedI rerolled patch #3, with the added benefit of the site builder being able to choose what entities that the redirect module gets applied too. The additional settings were added to the redirect settings page '/admin/config/search/redirect/settings'. By doing it this way we don't have to worry about applying patches to the field collection module or creating a custom module to implement a cleaner UI. Thanks!
Comment #8
Dave ReidPlease leave a UI separate from the issue.
Comment #9
Dave ReidComment #10
BWPanda CreditAttribution: BWPanda commentedJudging by Dave's comment in #8, this should be RTBC for the patch in #3.
Also marked #1340354: How do I remove URL Redirect Field for a Field Collection? as a duplicate of this issue.
Comment #11
BWPanda CreditAttribution: BWPanda commentedPatch from #3 didn't apply for me, updated patch for latest version of code.
Comment #12
maximpodorov CreditAttribution: maximpodorov commentedcommerce_order entity should be in the stop list also.
Comment #13
maximpodorov CreditAttribution: maximpodorov commentedAnd commerce_customer_profile entity should be in the stop list also.
Comment #14
droath CreditAttribution: droath commentedI have been working on a field attach UI module. It has an option that will allow you to hide attached fields for a given entity. I found this might be a better approach to solve this type of issue. It's currently a sandbox project, but once I get some feedback on this module, I plan on releasing a full version.
Please post any issues that you have in the field attach UI module issue queue.
https://drupal.org/sandbox/droath/1349866
Comment #15
pjcdawkins CreditAttribution: pjcdawkins commentedThe patch in #11 applies cleanly. However I'm not quite sure what it should do - I still get redirect fields on my custom entities for which I've specified
'redirect' => FALSE,
Comment #16
pjcdawkins CreditAttribution: pjcdawkins commentedActually it did work: the Redirect elements are no longer injected into forms for entities that have
'redirect' => FALSE
.But
redirect_field_extra_fields()
still doesn't respectredirect_entity_type_supports_redirects()
.Comment #17
kevinquillen CreditAttribution: kevinquillen commentedI am having this same issue with Field Collections where URL Redirects is attaching to every instance of a field collection item within the table row. Which one of the above patches will remove it from the GUI? Patch #11?
Comment #18
Shadlington CreditAttribution: Shadlington commented#11 + #4 works for me.
Comment #19
tirdadc CreditAttribution: tirdadc commentedDitto, thanks for this.
Comment #20
mrfelton CreditAttribution: mrfelton commentedPatch in #11 + code in 4 works well.
Comment #21
jwilson3Comment #20++
Comment #22
bdone CreditAttribution: bdone commented#11 + #4 works, thanks!
Comment #23
tancPatch in #11 works for me too.
For some reason #4 didn't work even after clearing caches.Implementing the hook_entity_info_alter() from #4 appears to be a requirement but doesn't work without the patch in #11.Comment #24
Dave ReidCommitted to 7.x-1.x with http://drupalcode.org/project/redirect.git/commit/2b091c6
Comment #26
lsolesen CreditAttribution: lsolesen commented@maximpodorov - I have created patches for commerce with what you requested.
- #1891990: Make sure that redirect module does not inject redirect into the product edit form
- #1892002: Prevent the Redirect module from altering Commerce entity forms.
- #1891998: Make sure that redirect module does not inject redirect into the order edit form
You could go review them.
Comment #27
mthomas CreditAttribution: mthomas commentedI've filed a similar issue w/patch for the relation module #2321509: Prevent relation module from altering relation forms.
Comment #28
solideogloria CreditAttribution: solideogloria commented