Hi! Love this module. I've been using it since 6 and was happy to see you ported it to d8 already. Thanks for sharing your code with the rest of us. Really appreciate all the time and energy you've put into it.

I'm getting this error when I try to run the bookmarklet in d8:

ERROR:
Notice: Undefined index: #type in Drupal\prepopulate\Controller\prepopulateController->_prepopulate_request_walk() (line 32 of modules/prepopulate/src/Controller/prepopulateController.php).

Now, it's entirely possible this is something I've done wrong in the bookmarklet. But thought I would give you a shout out and see if you might recognize something. I'm very front end and don't understand the error enough to go digging around in your code.

Thanks again for being so generous. This little module has saved me *so* much time over the years.

Kathy

Comments

kdmarks’s picture

Geez. I should have waited a few minutes. It was me. Working now.

Again, thank you so much for this module!

Kathy

JonFreed’s picture

Status: Active » Closed (cannot reproduce)

Marking as "Closed (cannot reproduce)". A better status might be something like "Closed (bad test)" or "Closed (opened by mistake)" because the opener stated "Geez. I should have waited a few minutes. It was me. Working now."

juliencarnot’s picture

I can reproduce this, with one "project" (custom content-type) node referencing a "resource" (custom content-type) node, through a entity reference field "field_p_resource".

Here is the URL I use:
node/add/project?edit[field_p_resource][0][target_id]=Ressource%20utilisée(49)

(49 being the id of my resource node and "Ressource utilisée" being the field label)

I get this error message:

Notice: Undefined index: #type in Drupal\prepopulate\Controller\prepopulateController->_prepopulate_request_walk() (line 32 of modules/prepopulate/src/Controller/prepopulateController.php).

Drupal\prepopulate\Controller\prepopulateController->_prepopulate_request_walk(Array, Array)
prepopulate_after_build(Array, Object)
call_user_func_array('prepopulate_after_build', Array)
Drupal\Core\Form\FormBuilder->doBuildForm('node_project_form', Array, Object)
Drupal\Core\Form\FormBuilder->processForm('node_project_form', Array, Object)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object)
Drupal\node\Controller\NodeController->add(Object)
call_user_func_array(Array, Array)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)

If I edit the prepopulateController.php on line 32 and replace occurences of "values" by "target_id", the notice disappears.

Note that in either cases, my entity reference field doesn't get the right value, but I guess this is rather because I can't seem to find the right syntax. Any hints on that would be greatly appreciated, I've tried quite a lot of combinations but no luck so far!

juliencarnot’s picture

Status: Closed (cannot reproduce) » Active
juliencarnot’s picture

Status: Active » Closed (cannot reproduce)

Can no longer reproduce this with 8.x-2.0-alpha1 .

fadgadget’s picture

not working for me (alpha)

D7 (working)
/node/add/links?edit[title]='+escape(t)+'&edit[field_external_link][und][0][url]='+escape(u),'_blank'

D8 field now-
field_external_link[0][uri]

Tried all kinds of things with it. Was hoping it would simply be

[field_external_link][0][uri]=

but to no avail. It fills the title in ok. All help and advice appreciated. thanks

edit: I dont get an error message i just dont get the link field prepopulated

dqd’s picture

Status: Closed (cannot reproduce) » Needs work

Still reproducable with #value and #type

But, possibly just a documentation or unfinished port D8 issue. In D8 version it has no help pages with examples nor an entry in the reports > updates. Needs maintainer comment.

super_romeo’s picture

Try this format: ?edit[field_page][widget][0][target_id]=2
see: https://www.drupal.org/project/prepopulate/issues/2668010#comment-12801667

heddn’s picture

Status: Needs work » Closed (cannot reproduce)

If you see a new bug, please don't re-open a 2 year old issue. Instead, open a new bug.

dqd’s picture

In drupal.org issue life cycles in doesn't matter if an issue is 2 years old, unless we talk about complete other core compatibility levels here. If an old bug persist or re-occures I strongly recommend to reopen old issues for better back tracking. But if it is caused by another bug now, I agree. Tests here still lead to the assumption that this issue report fits and persists, but, for peace and harmony, I keep this issue in the state the maintainer recommends.