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: Trying to add new preview templates results in crash

Status Resolved
Add-on / Version Publisher 2.11.1 build 0936f6a5
Severity
EE Version 5.2.3

Bruce Sabalaskey

Jun 21, 2019

I have been using Publisher since EE3. I have updated the site to EE5, and have been adding new features for new channels podcasts and episodes in EE5. I have created specific preview templates for those channels and have added them in the backend. I have a lot of channels and some have preview templates, and some do not. However, when I try to add the preview templates for these new channels, the backend crashes with an SQL error. The drop down box for selecting the template properly sees the template group and name (podcasts/preview and episodes/preview), and I use the url_title with that template.

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘’ for column ‘template_id’ at row 1:
UPDATE `exp_publisher_previews` SET `template_id` = ‘’ WHERE `id` = 1

ee/legacy/database/drivers/mysqli/mysqli_connection.php:117
Stack Trace: Please include when reporting this error

  #0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query(‘UPDATE `exp_pub…’)
  #1 ee/legacy/database/DB_driver.php(270): CI_DB_mysqli_driver->_execute(‘UPDATE `exp_pub…’)
  #2 ee/legacy/database/DB_driver.php(180): CI_DB_driver->simple_query(‘UPDATE `exp_pub…’)
  #3 ee/legacy/database/DB_active_rec.php(1477): CI_DB_driver->query(‘UPDATE `exp_pub…’)
  #4 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(129): CI_DB_active_record->update(‘publisher_previ…’)
  #5 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(99): EllisLab\ExpressionEngine\Service\Model\Query\Update->actOnGateway(Object(EllisLab\ExpressionEngine\Service\Model\SyntheticGateway), Object(BoldMinded\Publisher\Model\Preview))
  #6 ee/EllisLab/ExpressionEngine/Service/Model/Query/Update.php(48): EllisLab\ExpressionEngine\Service\Model\Query\Update->doWork(Object(BoldMinded\Publisher\Model\Preview))
  #7 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(282): EllisLab\ExpressionEngine\Service\Model\Query\Update->run()
  #8 ee/EllisLab/ExpressionEngine/Service/Model/DataStore.php(248): EllisLab\ExpressionEngine\Service\Model\DataStore->runQuery(‘Update’, Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
  #9 ee/EllisLab/ExpressionEngine/Service/Model/Query/Builder.php(71): EllisLab\ExpressionEngine\Service\Model\DataStore->updateQuery(Object(EllisLab\ExpressionEngine\Service\Model\Query\Builder))
  #10 ee/EllisLab/ExpressionEngine/Service/Model/Model.php(361): EllisLab\ExpressionEngine\Service\Model\Query\Builder->update()
  #11 user/addons/publisher/Controllers/Manage/Previews.php(221): EllisLab\ExpressionEngine\Service\Model\Model->save()
  #12 user/addons/publisher/Controllers/Manage/Previews.php(85): BoldMinded\Publisher\Controllers\Manage\Previews->savePreviewsCallback()
  #13 user/addons/publisher/Controllers/AbstractController.php(511): BoldMinded\Publisher\Controllers\Manage\Previews->BoldMinded\Publisher\Controllers\Manage\{closure}(Array)
  #14 user/addons/publisher/Controllers/Manage/Previews.php(72): BoldMinded\Publisher\Controllers\AbstractController->handleSubmit()
  #15 user/addons/publisher/mcp.publisher.php(142): BoldMinded\Publisher\Controllers\Manage\Previews->render(‘manage/previews’)
  #16 user/addons/publisher/mcp.publisher.php(93): Publisher_mcp->runController()
  #17 [internal function]: Publisher_mcp->manage(‘previews’)
  #18 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1662): call_user_func_array(Array, Array)
  #19 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(946): EllisLab\ExpressionEngine\Controller\Addons\Addons->getModuleSettings(‘publisher’, ‘manage’, Array)
  #20 [internal function]: EllisLab\ExpressionEngine\Controller\Addons\Addons->settings(‘publisher’, ‘manage’, ‘previews’)
  #21 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
  #22 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
  #23 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
  #24 public_html/lsncp.php(153): require_once(’...’)
  #24 public_html/lsncp.php(153): require_once(’...’)

Regards,
Bruce

#1

BoldMinded (Brian)

What version of MySQL?

#2

Bruce Sabalaskey2

mysql Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using EditLine wrapper On Ubtuntu 16.04 LTS sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

#3

Bruce Sabalaskey2

FYI, your asking triggered an idea. The STRICT_TRANS_TABLES makes it fail. If I remove that on the SQL server, then it works without complaint. This is related to some channels have a preview and some do not. It is failing because of the channels which do not have a preview attached (about half of them).

#4

BoldMinded (Brian)

Sorry for the delay. This is a pretty easy fix. On line 203 of Controllers/Manage/Previews.php add the following line. It’ll ensure that an int value, not a blank string, is inserted into the DB, thus avoiding the error.

$templateId = $templateId ?: 0;
#5

Bruce Sabalaskey2

Thanks, that worked.

#6

BoldMinded (Brian)

Excellent. This will be included in the next release, which will probably be version 3.0.

Login to reply