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

"Media of" does not get automatically populated #1028

Closed
Natkeeran opened this issue Feb 19, 2019 · 3 comments
Closed

"Media of" does not get automatically populated #1028

Natkeeran opened this issue Feb 19, 2019 · 3 comments

Comments

@Natkeeran
Copy link
Contributor

Natkeeran commented Feb 19, 2019

Vagrant up f56feb06011d5827712fa7cd3fc861c3bc427669 playbook. Added a repository item. When adding media to the repository item the Media of is not automatically populated.

Goes to this url http://localhost:8000/media/add/image?edit%5Bfield_media_of%5D=4

Additional Info:


Location | http://localhost:8000/media/add/file?edit%5Bfield_media_of%5D=4
-- | --
http://localhost:8000/node/4/media/add
Notice: Undefined index: #value in Drupal\prepopulate\Populate->populateForm() (line 111 of /var/www/html/drupal/web/modules/contrib/prepopulate/src/Populate.php)  #0 /var/www/html/drupal/web/core/includes/bootstrap.inc(584):  _drupal_error_handler_real(8, 'Undefined index...',  '/var/www/html/d...', 111, Array) #1  /var/www/html/drupal/web/modules/contrib/prepopulate/src/Populate.php(111):  _drupal_error_handler(8, 'Undefined index...', '/var/www/html/d...',  111, Array) #2  /var/www/html/drupal/web/modules/contrib/prepopulate/src/Populate.php(100):  Drupal\prepopulate\Populate->populateForm(Array, '4') #3  /var/www/html/drupal/web/modules/contrib/prepopulate/prepopulate.module(30):  Drupal\prepopulate\Populate->populateForm(Array) #4 [internal function]: prepopulate_after_build(Array,  Object(Drupal\Core\Form\FormState)) #5  /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(1068):  call_user_func_array('prepopulate_aft...', Array) #6  /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(561):  Drupal\Core\Form\FormBuilder->doBuildForm('media_file_add_...',  Array, Object(Drupal\Core\Form\FormState)) #7  /var/www/html/drupal/web/core/lib/Drupal/Core/Form/FormBuilder.php(318):  Drupal\Core\Form\FormBuilder->processForm('media_file_add_...',  Array, Object(Drupal\Core\Form\FormState)) #8  /var/www/html/drupal/web/core/lib/Drupal/Core/Controller/FormController.php(93):  Drupal\Core\Form\FormBuilder->buildForm('media_file_add_...',  Object(Drupal\Core\Form\FormState)) #9 [internal function]:  Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request),  Object(Drupal\Core\Routing\RouteMatch)) #10  /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123):  call_user_func_array(Array, Array) #11  /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(582):  Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #12  /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124):   Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext),  Object(Closure)) #13  /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97):   Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array,  Array) #14 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(151):   Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #15 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(68):  Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request),  1) #16  /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57):   Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request),  1, true) #17  /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47):   Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request),  1, true) #18  /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99):   Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request),  1, true) #19  /var/www/html/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78):   Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request),  1, true) #20  /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47):   Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request),  1, true) #21  /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52):   Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request),  1, true) #22  /var/www/html/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23):   Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request),  1, true) #23 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(665):   Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request),  1, true) #24 /var/www/html/drupal/web/index.php(19):  Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #25 {main}.

@kayakr
Copy link
Contributor

kayakr commented Feb 25, 2019

@Natkeeran I think Prepopulate changed its syntax at some point. A path like /media/add/image?edit[field_media_of][widget][0][target_id]=23 works for me.

@kayakr
Copy link
Contributor

kayakr commented Feb 25, 2019

@Natkeeran Hmm, but that style doesn't seem to work for field_members_of.

@seth-shaw-unlv
Copy link
Contributor

Resolved via /pull/117

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

No branches or pull requests

4 participants