Since I have installed the new version of module (1.8) and when I try to add a file in a field file in my form an error message appears:
Error: content has no workflow attached. The data is not saved.
I specify that this form contains a field of type workflow state.
Then I tried to save my form values by validate it and it is not possible as an error displayed : This value can't be null
Can you fix this please?
Thanks a lot for your help.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | workflow_3452716_8_undefined_key.patch | 7.46 KB | johnv |
Comments
Comment #2
jaswinsingh commented+1 Facing similar error, I have an eck entity referenced in the user entity, where the eck entity is created on the user register form using IEF. This entity has workflow already attached to it, After using the latest version 1.8, I am getting this error when saving the user register form This value should not be null
Comment #3
dcoppel commentedI have IEF fields too in my form like you Jaswinsingh !
Comment #4
ighosh commentedHi @dcoppel @Jaswinsingh, I have a fresh Drupal site. Could you tell me the steps to reproduce this issue so I can work on the fix? Thanks!
Comment #5
dcoppel commentedHi @IGhosh,
Thanks to help us !
You can try to create a node type with a file field and a field type of workflow state.
Then you can create an other node type with only two text fields.
Then after installed IEF module, you can add in the first node type a field that refer to the the second node type (to add the fsecond form in the first one).
Then try to add a node base on first node type to see if it works.
Thanks for your help.
Regards
Comment #6
johnvI now see 2 use cases:
First:
- have a node type with Workflow and File
- create a node, add a file, save the node. Erro occurs because the 'triggering element' is not the save button, but "field_file_0_upload_button". After saving again, node seems to be saved correctly.
- the error does not occur is no file is uploaded.
Second:
- have a node type with Workflow and IEF.
- Did not test, but may have the same test script and result.
Comment #7
johnvComment #8
johnvPlease check attached patch.
Comment #9
dcoppel commentedHi @johnv,
Thanks for your post.
I was intalled your patch but I have the same result.
1- Loading file : An error displayed after file load (Error: content has no workflow attached. The data is not saved.), this error is just up to file field but the file is loading fine.
2- I can submit the form for a new node but I can't submit the form when modifying the node : general form error message appears : This value can't be null.
Thanks for your help.
Comment #10
johnvThanks,
do you use select/radios in workflow difeinition, or action button/dropbutton?
Comment #11
johnvAnd your file field is attached to the entity/node itself, not to the workflow?
Comment #12
dcoppel commentedHi,
I use actions button in my workflow. And my field file is attached directly to my entity/node.
Let me know if you need more informations.
Thanks for your help.
Regards
Comment #13
johnvWorking on this. I think i found a Solution.
Problem was a test on isNew() Which is True after adding/removing the file.
Cleaning up the code now.
Comment #15
johnvComment #16
dcoppel commentedHi @johnv,
I just install and test your last commit and the two problems I had seems to be correct now !
Thanks a lot !
Comment #17
iaacristobalI'm encountering an issue applying the patch. It's returning this error on my end:
I applied this using composer-patches. I also did a build test and it says "Patch failed to apply"
Comment #18
johnvThere is no patch provider for this against 1.8 version. Please use dev version.
Comment #19
tikaszvince commentedHi @johnv,
Any chance of creating a new release with these fixes in the next few days?
Comment #20
johnvYex, I will this week.
I am waiting for response on #3454558: TypeError: WorkflowTransitionElement::copyFormValuesToTransition() (line 356) when hiding subfields
Comment #21
rfmarcelino commentedI'm unsure if this will help, but let me share my experience.
for context, I have a node type using a workflow and I'm using the 'Workflow transition form' widget and a field with Entity Browser.
While creating a new node, and running Ajax (opening entity Browser) I get:
Error: content has no workflow attached. The data is not saved.
I tried to install the dev version but started getting this error even without touching the form:
TypeError: Drupal\Core\Field\WidgetBase::errorElement(): Argument #1 ($element) must be of type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php on line 580 in Drupal\Core\Field\WidgetBase->errorElement() (line 646 of /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php)
For now, I locked it to 1.7 in composer.json
"drupal/workflow": "1.7",and it works well.
In 1.7 and prior $form["field_wf_status"]["widget"][0]["workflow_transition"]["#value"]) was set and in 1.8 is NULL
Comment #22
johnv@rfmarcelino, Thanks for your response.
Regarding the error 'Argument #1 ($element)', did you change anything in the settings for 'Manage form display' of the workflow?
Comment #24
dcoppel commentedUnfortunately, I have the same issue as @rfmarcelino :
TypeError : Drupal\Core\Field\WidgetBase::errorElement(): Argument #1 ($element) must be of type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php on line 580 dans Drupal\Core\Field\WidgetBase->errorElement() (ligne 646 de /var/www/drupalextranet/web/core/lib/Drupal/Core/Field/WidgetBase.php)
I check in 'Manage form display' of the workflow. I think I changed nothing in this part but I saw in field "To state" that the value is set to "Inline Entity Form - Simple".
Let me know if you need more information to help.
Regards,
Comment #25
dcoppel commentedI saw in 'Manage form display' that three field added between v. 1.7 and 1.8 : To state, Timestamp and Log message that was activating.
I don't know if there is a link with the error...
Comment #26
johnvLet us continue this conversation in #3458984: TypeError: 'WidgetBase::errorElement(): Argument #1 ($element) must be of type array, null given, called in WidgetBase.php'.
Please post your error over there (to preserve your user name) with precise use case and modules.
@rfmarcelino, I tested with Entity Brouwser and IEF installed, but in the EntityBrowser widget, I see an empty field 'browser'.
when creating a new node, I get the error:
Comment #27
johnvComment #28
pdcarto commentedThis issue is marked "Closed (fixed)" but it has not been tagged into a release. That forces anyone who wants to use this fix to use a dev branch of this module which, by definition, is not recommended for production sites.
The remaining open related issue is weakly described (no steps to reproduce, unable to be reproduced by some commenters) and should not, in my opinion, block getting this work out to a tagged release.
@johnv, would you be willing to get this merged/tagged into a release?