<em class="placeholder">InvalidArgumentException</em>: Placeholders must have a trailing [] if they are to be expanded with an array of values. in <em class="placeholder">Drupal\Core\Database\Connection->expandArguments()</em> (line <em class="placeholder">729</em> of <em class="placeholder">core/lib/Drupal/Core/Database/Connection.php</em>). <pre class="backtrace">Drupal\Core\Database\Connection->query('SELECT n.nid FROM {node} n WHERE n.status = :status AND n.type IN (:types) ORDER BY n.nid', Array, Array) (Line: 87)
Drupal\Core\Database\Driver\mysql\Connection->query('SELECT n.nid FROM {node} n WHERE n.status = :status AND n.type IN (:types) ORDER BY n.nid', Array, Array) (Line: 61)
db_query('SELECT n.nid FROM {node} n WHERE n.status = :status AND n.type IN (:types) ORDER BY n.nid', Array) (Line: 15)
_linkchecker_batch_import_nodes(Array) (Line: 369)
Drupal\linkchecker\Form\LinkCheckerAdminSettingsForm->submitAnalyzeLinks(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder->processForm('linkchecker_admin_settings', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('linkchecker_admin_settings', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 664)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
</pre>
Comments
Comment #2
hass commentedPlease share a patch.
Comment #3
siva01 commentedThere is patch, which should solve it. Problem is at outdated database queries.
Comment #4
hass commentedThis looks not correct.
I guess this need to be a merge query. With inserts this could lead to duplicate entry issues.
Comment #5
shubhangi1995Comment #6
shubhangi1995hi @hass,
doubts from your side:
1) - $operations[] = ['_linkchecker_batch_node_import_op', [$row->nid]];
+ $operations[] = ['_linkchecker_batch_node_import_op', [$row]];
here $row is being used at place of the nid of the nodes which are of the CT for which lick checking is to be done, I think this is what we require as the operation function is also loading the node on the basis of variable from $row only. If my understanding is wrong and we require a value other than node id please let me know.
2) drupal_write_record('linkchecker_link', $link);
+
+
+ $connection->insert('linkchecker_link')
+ ->fields([
+ 'urlhash' => $urlhash,
+ 'url' => $url,
+ 'status' => _linkchecker_link_check_status_filter($url)
+ ])
+ ->execute();
will not be leading to duplication as in case of linkchecker_link table first it looks for the specific hash if not found then only it inserts the link object in table
Updation in patch:
1) removal of status colunm as its missing in Drupal 8 node table.
2) addition of new variable lid as the the old variable link dint had lid assigned to it.
if everything fine please mention areas where work is left related to this module.
Comment #7
shubhangi1995Comment #8
hass commentedI have not tested, but I guess it need to be
$row->id()- at least we need the node id and not the complete database row. _linkchecker_batch_node_import_op() function expects to get the node id.We need to make sure a node is only scanned if it is pulished. If status has been moved somewhere else we need to get the info from there.
Comment #9
shubhangi1995Hi @hass
the [row] is sending the node id only hence is according to requirement and have updated the patch so that we check the status too please review.
Comment #10
shubhangi1995final patch according to the changes recommended
Comment #11
waverate commentedPatch at #10 does not apply cleanly against 8.x-1.x-dev (Last updated: 31 Oct 2018 at 07:28 EDT).
It probably needs to be re-rolled.
Comment #12
hass commentedI guess this issue is resolved in latest dev. Please test.
Comment #13
shubhangi1995yes it worked , thanks
Comment #14
hass commented