- Issue created by @marksmith
- First commit to issue fork.
- Status changed to Needs review
11 months ago 4:54am 18 December 2023 - 🇮🇳India viren18febS
HI @marksmith
I have added a patch with the fixes,
Thanks - 🇫🇷France lazzyvn paris
The problem I know before, It is not compatible with drupal 10.2. Field storage in Drupal 10.2 previously changed that when you create a field, it creates a stored field with a value, the data field base on this to hook the field storage.
#ajax form changed wrapper to wrapper_selector
#state change to field_storage[subform][settings][storage]
$form_state->getValue has had major changes
I don't have much free time to fix it rightnow, wait at least 3 months for 2.x, because my customers are still happy with 10.1. they don't want to update to version 10.2 - 🇮🇪Ireland marksmith
Thank you for the quick reaction. I understand the problem and I'm eagerly waiting for the fix! Drupal 10.2 introduced a few attractive user friendly updates (an also caused some technical troubles, as I see), so that it would be a pity to miss it. :) Thanks for your efforts invested in this great module!
- 🇫🇷France lazzyvn paris
- I lock version 1.x to 10.2 avoid someone try to install to drupal 10.2
- Seek someone who can port datafield to drupal 10.2- Begin with this Rendering \Drupal\field_ui\Form\FieldStorageConfigEditForm outside of a subform is deprecated →
- Something need to change Field configuration forms restructured: Field Storage Configuration Form is now a subform within Field Configuration Edit Form →
- FieldStorageAddForm has new structure →
- Field and Field Storage config entities now don't get saved until after the last step in the field creation workflow →
- Save FieldStorageConfig at the same time as FieldConfig →
- Status changed to Fixed
11 months ago 3:23pm 30 December 2023 - 🇮🇪Ireland marksmith
It's great you started working on this module! I checked the alpha version (dev wasn't working for me). The alpha version basically works with Drupal 10.2, with the limitations that you highlight on the module page (it's not possible to alter the schema after the field had been created).
One thing I observed for now is that I am unable to add more than one value to a multivalue Data field. (One has to edit the content in order to add a further value).
Another thing is that if a date field is added, and the content is edited, it throws this error: InvalidArgumentException: The date cannot be created from a format. in Drupal\Component\Datetime\DateTimePlus::createFromFormat() (line 253 of core/lib/Drupal/Component/Datetime/DateTimePlus.php).
- 🇮🇪Ireland marksmith
Tried with alpha3 (december 31).
I tried with the following data field setup: 1. text field, 2. date field, 3. datetime field, 4. entity reference field.
1. Composer automatically downloads and installs beta2 (even if alpha is requested).
2. Date field is working.
3. Datetime field value gives this error in Reports: Warning: Undefined array key "object" in Drupal\Core\Datetime\Element\Datetime::validateDatetime() (line 365 of /var/www/html/web/core/lib/Drupal/Core/Datetime/Element/Datetime.php)
4. Entity reference field (referencing Article from Basic page) is not working on form view, throws an AJAX error in console and this error in reports: InvalidArgumentException: The #default_value property has to be an entity object or an array of entity objects. in Drupal\Core\Entity\Element\EntityAutocomplete::valueCallback() (line 114 of core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php). - 🇫🇷France lazzyvn paris
Fixed some bug in entity reference and datetime in rc version
- 🇮🇪Ireland marksmith
Much better with RC 5!
A few things I noted.1. File - It works with the widget option file upload. However, if I select the form widget Media library I receive this error:
Warning: Undefined array key "#title" in datafield_preprocess_field_multiple_value_form() (line 196 of /var/www/html/web/modules/contrib/datafield/datafield.module)
2. Have you considered adding an option for private files?Aside of that:
3. With Devel generate I receive this error:Warning: Undefined array key "date" in Drupal\datafield\Plugin\Field\FieldType\DataField::generateSampleValue() (line 698 of modules/contrib/datafield/src/Plugin/Field/FieldType/DataField.php).
(with reference, etc. as well) - 🇫🇷France lazzyvn paris
I added option uri schemas (private file) but I don't know if it works
- 🇮🇪Ireland marksmith
Private file field works, great job!
Two further errors and suggestions:
1. After saving content (with an entity reference and a file field), datafield throws this error:
TypeError: Unsupported operand types: null + array in Drupal\datafield\Plugin\Field\FieldFormatter\DataFieldTable->viewElements() (line 300 of /var/www/html/web/modules/contrib/datafield/src/Plugin/Field/FieldFormatter/DataFieldTable.php).
This line is problematic:$components[$subfield] += $components['formatter_settings'][$subfield];
does not work. Apparently we need to check whether whether $components[$subfield] is an array before combining it with another array. So this worked:if (!isset($components[$subfield])) $components[$subfield] = []; $components[$subfield] += $components['formatter_settings'][$subfield];
This, however, also worked.
$components[$subfield] = $components['formatter_settings'][$subfield];
2. There was another error on saving content:
Warning: Undefined array key "date" in Drupal\datafield\Plugin\Field\FieldFormatter\DataFieldTable->viewElements() (line 297 of modules/contrib/datafield/src/Plugin/Field/FieldFormatter/DataFieldTable.php).
This correction worked:
if (isset($components[$subfield]) && isset($components[$subfield]["type"])) { $align[$subfield] = in_array($components[$subfield]["type"], ['integer', 'numeric', 'float']) ? 'right' : ''; }
- 🇮🇪Ireland marksmith
Changing issue title in accordance with further discussion.
- 🇮🇪Ireland marksmith
Sorry, coming back yet again with the private file issue. The file is correctly saved to the private folder, but it cannot be opened afterwards from the saved content page (Access denied error, even for admin).
- 🇫🇷France lazzyvn paris
Oh I knew it. you can't download private files even if you have the right link because it will check the field type and field permissions. data field is not an entity file type, it cannot load file headers without header it means access denied. That's why i don't add option private file in version 1.
Automatically closed - issue fixed for 2 weeks with no activity.