Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix File URL Type widget unable to determine item type #3591

Merged
merged 3 commits into from
Aug 2, 2021

Conversation

clayliddell
Copy link
Contributor

@clayliddell clayliddell commented Jul 28, 2021

fixes #3590

QA Steps

Part 1

  • Create a DKAN dataset with a resource.
  • Navigate to the edit form for the dataset.
  • Ensure the following error does not appear on the page or in watchdog:
Notice: Undefined index: file_url_type in Drupal\json_form_widget\Element\UploadOrLink::loadLocalFilesWhenDefault() (line 187 of /var/www/docroot/modules/contrib/dkan/modules/json_form_widget/src/Element/UploadOrLink.php)

#0 /var/www/docroot/core/includes/bootstrap.inc(600): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/docroo...', 187, Array)
#1 /var/www/docroot/modules/contrib/dkan/modules/json_form_widget/src/Element/UploadOrLink.php(187): _drupal_error_handler(8, 'Undefined index...', '/var/www/docroo...', 187, Array)
#2 /var/www/docroot/modules/contrib/dkan/modules/json_form_widget/src/Element/UploadOrLink.php(85): Drupal\json_form_widget\Element\UploadOrLink::loadLocalFilesWhenDefault(Array)
#3 [internal function]: Drupal\json_form_widget\Element\UploadOrLink::processManagedFile(Array, Object(Drupal\Core\Form\FormState), Array)
#4 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1008): call_user_func_array(Array, Array)
#5 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#6 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#7 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#8 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#9 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#10 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#11 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#12 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#13 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(1071): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#14 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(575): Drupal\Core\Form\FormBuilder->doBuildForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#15 /var/www/docroot/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('node_data_edit_...', Array, Object(Drupal\Core\Form\FormState))
#16 /var/www/docroot/core/lib/Drupal/Core/Controller/FormController.php(91): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
#17 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#18 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#19 /var/www/docroot/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#20 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#21 /var/www/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#22 /var/www/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#23 /var/www/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#24 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/docroot/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /var/www/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#34 {main}

Part 2

  • Create a DKAN dataset with an uploaded resource.
  • Navigate to the edit form for the dataset and ensure the upload or link widget contains the uploaded file.
  • Ensure an import queue job was created for the uploaded resource.
  • Create a DKAN dataset with an link resource.
  • Ensure an import queue job was created for the linked resource.
  • Navigate to the edit form for the dataset and ensure the upload or link widget contains the link.

@clayliddell clayliddell self-assigned this Jul 28, 2021
@clayliddell clayliddell requested a review from dafeder July 28, 2021 20:51
@clayliddell
Copy link
Contributor Author

This bug was creating two separate issues which is why the QA instructions are divided up into 2 parts.

@janette
Copy link
Member

janette commented Aug 2, 2021

Follow up:

@janette janette merged commit 73a398b into 2.x Aug 2, 2021
@janette janette deleted the fix-file-url-type-widget branch May 19, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encountering Undefined index: file_url_type... error when navigating the the Edit Dataset form
2 participants