Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
Selection_200.png | 48.71 KB | ChrisSnyder | |
#22 | diff.txt | 2.93 KB | davidwbarratt |
#22 | copied-field-does-not-have-widget-field-settings-2822398-22.patch | 2.45 KB | davidwbarratt |
Comments
Comment #2
jacobfrancke@gmail.com CreditAttribution: jacobfrancke@gmail.com commented+1
Comment #3
thiagomoraesp CreditAttribution: thiagomoraesp commented+1
Comment #4
kriboogh CreditAttribution: kriboogh commentedThe summary function is missing, which is needed to display the form.
I'll try to cook up a patch, but in the mean time just add this method to DisplayFieldCopy.php
Comment #5
kriboogh CreditAttribution: kriboogh commentedTo make this work properly this also needs a patch for ds in the file field_ui.inc at line 1117.
Patch is coming up just need the time to make it.
Comment #6
kriboogh CreditAttribution: kriboogh commentedHere is the patch
Comment #7
kriboogh CreditAttribution: kriboogh commentedExtra fix, apparently the prepareView isn't called before the elements are handled.
Comment #8
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedI cant't apply the patch against the 1.0 release.
Why is it made for alpha3 version (like it says in the version)?
Comment #9
davidwbarratt CreditAttribution: davidwbarratt as a volunteer commentedComment #10
arunkumarkHi,
I have rerolled the patch for the latest version of Display Field Copy module.
Comment #11
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commented#10 Works. Thank you!
However I get a Notice [1] on node display page (admin/structure/types/manage/event/display) if the Field copy is not placed on the layout. Meaning it is disabled.
[1] Notice: Undefined index: formatter in Drupal\display_field_copy\Plugin\DsField\DisplayFieldCopy->settingsSummary() (line 134 of modules/contrib/display_field_copy/src/Plugin/DsField/DisplayFieldCopy.php).
Drupal\display_field_copy\Plugin\DsField\DisplayFieldCopy->settingsSummary(Array) (Line: 631)
ds_field_settings_summary(Object, Array, Object) (Line: 1248)
_ds_field_ui_fields('node', 'event', 'default', Array, Object) (Line: 46)
ds_field_ui_fields_layouts(Array, Object) (Line: 247)
ds_form_entity_view_display_edit_form_alter(Array, Object, 'entity_view_display_edit_form') (Line: 501)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'entity_view_display_edit_form') (Line: 819)
Drupal\Core\Form\FormBuilder->prepareForm('entity_view_display_edit_form', Array, Object) (Line: 272)
Drupal\Core\Form\FormBuilder->buildForm('entity_view_display_edit_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Notice: Undefined index: formatter in Drupal\display_field_copy\Plugin\DsField\DisplayFieldCopy->settingsSummary() (line 134 of modules/contrib/display_field_copy/src/Plugin/DsField/DisplayFieldCopy.php).
Drupal\display_field_copy\Plugin\DsField\DisplayFieldCopy->settingsSummary(Array) (Line: 631)
ds_field_settings_summary(Object, Array, Object) (Line: 1248)
_ds_field_ui_fields('node', 'event', 'default', Array, Object) (Line: 46)
ds_field_ui_fields_layouts(Array, Object) (Line: 247)
ds_form_entity_view_display_edit_form_alter(Array, Object, 'entity_view_display_edit_form') (Line: 501)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'entity_view_display_edit_form') (Line: 819)
Drupal\Core\Form\FormBuilder->prepareForm('entity_view_display_edit_form', Array, Object) (Line: 272)
Drupal\Core\Form\FormBuilder->buildForm('entity_view_display_edit_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment #12
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedComment #13
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedComment #14
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedComment #15
davidwbarratt CreditAttribution: davidwbarratt as a volunteer commentedThe notice has to be fixed.
Comment #16
arunkumark@TipiT can you share the Drupal core version you are using?
Comment #17
DiegoPino CreditAttribution: DiegoPino as a volunteer commentedHi, the issue reported by @TipiT on applying the provided patch still persists. Problem is related to the fact that Disabled fields do not store configurations (they are basically removed from a Display, which means 'formatter' key simply does not exist at field level). The following patch applies cleanly over 8.x-1.x .
Side note: because the way Ds handles the Display field list form (and the fact that settings totally depend on having a Summary present) , if you move a field from enabled to disabled, save and then you move it back to enabled, expected behavior on setting a formatter widget is a bit confusing. You have to save the changes to current display before the Widget settings appear again. Let me know if this fixes the current issue and maybe we could add a more informative message (Somewhere?) about this on the UI on a separate one or directly on Ds.
I also did a minor change in the class definition. It feels more portable if the class implements directly
DsFieldInterface
Interface instead of cherry-picking only the container injection piece which is also included in DsFieldInterface. That way this field can be used every-time a DsField Interface is expected.(My first Drupal contribution, so please forgive any mistakes in the workflow)
Comment #18
kriboogh CreditAttribution: kriboogh commentedKicking the testbot.
Comment #19
kriboogh CreditAttribution: kriboogh commentedah,.. no testbot, but still needs review :-)
Comment #20
DiegoPino CreditAttribution: DiegoPino as a volunteer commentedHi @davidwbarratt, if you have some time, could you please give this patch a review? Thanks
Comment #21
mansspams CreditAttribution: mansspams at Wunder commentedPatch #17 works IRL
Comment #22
davidwbarratt CreditAttribution: davidwbarratt for Sail Venice commentedI made a few formatting changes, please retest. :)
Comment #23
DiegoPino CreditAttribution: DiegoPino as a volunteer commentedHi @davidwbarratt, thanks! looks good. Thanks for the corrections.
Comment #24
DiegoPino CreditAttribution: DiegoPino as a volunteer commentedAny change this getting merged soon?
Thanks
Comment #26
davidwbarratt CreditAttribution: davidwbarratt for Sail Venice commentedComment #27
DiegoPino CreditAttribution: DiegoPino as a volunteer commented@davidwbarratt thank you!