All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Database Error when publishing

Status Resolved
Add-on / Version Publisher
Severity Critical
EE Version 31

Johannes Lamers

Jun 10, 2013

After publishing an item i get this error:

A Database Error Occurred
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 3

SELECT `page_url`, `url_title`, `publisher_lang_id`, `publisher_status`, `entry_id` FROM (`exp_publisher_titles`) WHERE `entry_id` IN ()

Filename: third_party/publisher/models/publisher_site_pages.php

Line Number: 201


PHP version: 5.3.8
MySQL version: 5.5.15

#1

BoldMinded (Brian)

If you don’t mind editing PHP, try this change:

line 197

if (is_array($entry_id) && !empty($entry_id))

#2

Johannes Lamers

Nope. No good. A new error appears:

A Database Error Occurred Error Number: 1054

Unknown column ‘Array’ in ‘where clause’

SELECT page_url, url_title, publisher_lang_id, publisher_status, entry_id FROM (exp_publisher_titles) WHERE entry_id = Array

Filename: third_party/publisher/models/publisher_site_pages.php

Line Number: 207

#3

BoldMinded (Brian)

What if you update the whole method to this?

private function get_url_titles($entry_id)
    {
        if (is_array($entry_id) && !empty($entry_id))
        {
            $qry = ee()->db->select('page_url, url_title, publisher_lang_id, publisher_status, entry_id')
                            ->where_in('entry_id', $entry_id)
                            ->get('publisher_titles');
        }
        else if($entry_id)
        {
            $qry = ee()->db->select('page_url, url_title, publisher_lang_id, publisher_status, entry_id')
                            ->where('entry_id', $entry_id)
                            ->get('publisher_titles');
        }
        else
        {
            return array();
        }
        

        $url_titles = array();

        foreach ($qry->result() as $row)
        {
            $url_titles[$row->publisher_status][$row->publisher_lang_id][$row->entry_id] = ($row->page_url != '') 
                ? $row->page_url 
                : $row->url_title;
        }

        return $url_titles;
    }
#4

Johannes Lamers

It works! Thanks a lot!!!!

Login to reply