Cannot add platforms: Invalid parameter number: number of bound variables does not match number of tokens:

Created on 5 August 2022, over 2 years ago
Updated 16 December 2023, over 1 year ago

Problem/Motivation

node/add/platform

https://mysite/node/add/platform|1||PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens: SELECT n.title AS name
Aug 5 17:47:13 dev mysite: FROM {hosting_platform} AS h
Aug 5 17:47:13 dev mysite: INNER JOIN {node} AS n ON n.nid = h.nid
Aug 5 17:47:13 dev mysite: WHERE publish_path = !publish_path
Aug 5 17:47:13 dev mysite: AND h.status >= !h.status; Array
Aug 5 17:47:13 dev mysite: (
Aug 5 17:47:13 dev mysite: [!publish_path] => /var/aegir/platforms/drupal/mydistro/html
Aug 5 17:47:13 dev mysite: [!h.status] => 0
Aug 5 17:47:13 dev mysite: )
Aug 5 17:47:13 dev mysite: in hosting_platform_path_exists() (line 697 of /var/aegir/myplatform/profiles/hostmaster/modules/aegir/hosting/platform/hosting_platform.module).

Error is triggered here: '!h.status' => HOSTING_PLATFORM_QUEUED,

function hosting_platform_path_exists($path) {
  $result = db_query("SELECT n.title AS name
    FROM {hosting_platform} AS h
      INNER JOIN {node} AS n ON n.nid = h.nid
    WHERE publish_path = !publish_path
      AND h.status >= !h.status",
    array(
      '!publish_path' => hosting_path_normalize($path),
      '!h.status' => HOSTING_PLATFORM_QUEUED,
    )
  )->fetch();
  return $result;
}

nginx
php 7.4.30
Drupal 7.91

the function in question

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024