How to fix a validation error, that only occurs right after a code update?

Not applicable

Whenever the dev portal code is updated, the first time any user submits an API, an error is thrown saying the machine readable name is not unique and then the objects are created anyways. This error happens even if the name is guaranteed to be unique. After the initial error, the site operates normally and we no longer get invalid errors concerning name conflicts.

To give some context, we use a custom content type called the publishing form to capture meta data for an API model. When the publishing form is saved, a model is created automatically from the data found in the publishing form along with the attached swagger document.

I think part of the problem, stems from a variable or setting that needs to cycle through a process or two before it clears and the site operates normally. Is anyone aware of startup processes or variables that could be involved with this problem?

3454-bug-398594-name-conflict.png

Thank you for your time,

Mitchel

Solved Solved
0 3 179
1 ACCEPTED SOLUTION

Not applicable

We had help from @Tamás Nagy, he realized double clicking the save button caused a validation error. Drupal thought the form was being submitted twice and this caused a name conflict. Tamas tweaked the code to disable the save button after submitting the form, while the page was processing. This has resolved the issue for us.

Thanks again, Tamas!

View solution in original post

3 REPLIES 3

@Mitchel Skees , What does developer portal log says ? Above error is displayed when API call to Edge returns APP name already in use. Please check Reports -> Recent logs for more details. Is the call to Edge successful ? I believe above validation error is mostly due to custom code. Debugging the custom module will help. Keep us posted.

Hey @Anil Sagar, I checked the logs and no report was made of the error. The model is created successfully, so I would assume the Edge call was successful. I will continue to work through this issue and provide updates.

Not applicable

We had help from @Tamás Nagy, he realized double clicking the save button caused a validation error. Drupal thought the form was being submitted twice and this caused a name conflict. Tamas tweaked the code to disable the save button after submitting the form, while the page was processing. This has resolved the issue for us.

Thanks again, Tamas!