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: Installation error

Status Resolved
Add-on / Version Publisher 2.7.9
Severity
EE Version 4.0.3

Eric Harth

Apr 03, 2018

Description:
As soon as I install Publisher, i see the error below and the installation breaks as well as my EE instance.
> Fatal error: Class ‘MyCLabs\Enum\Enum’ not found in /usr/local/www-shared/ee-acer/public/system/user/addons/publisher/Enum/Status.php on line 11

I think here’s another user with a similar issue on the Lite version: https://boldminded.com/support/ticket/1561

Detailed steps to reproduce the issue:
1. Just click install for Publisher in addon’s section
2.
3.

#1

BoldMinded (Brian)

Do you have a composer.json file or vendor folder anywhere else on your site?

#2

BoldMinded (Brian)

You could try what I suggested in the other thread. Publisher’s dependancies are the following:

"require": {
        "ramsey/array_column": "^1.1",
        "myclabs/php-enum": "^1.4",
        "monolog/monolog": "^1.19",
        "litzinger/file-field": "dev-master",
        "litzinger/basee": "dev-master",
        "guzzlehttp/guzzle": "^6.2",
        "caxy/php-htmldiff": "^0.1.3"
    }
#3

Eric Harth

The comment you might be referring to is private i think. It’s not visible to me. Also I’m not using composer. I could but would it tie-in with publisher, as its autoloader would be detached?

#4

BoldMinded (Brian)

If you’re not using Composer anywhere else on your project then something else is up. What version of PHP? Also, you’re on EE 4.0.3… why not update to 4.1.x? The auto built in updater makes it super easy to upgrade.

#5

Eric Harth

Will ping back with more info and updated EE version. Please keep this post open.

#6

Eric Harth

So we added composer and loaded the libraries listed above. Also we’ve upgraded the EE instance to 4.1.3.

This seems to have changed the error: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ” for column ‘field_id_348’ at row 1: INSERT INTO exp_publisher_data (entry_id, site_id, channel_id, lang_id, status, field_id_16, field_id_47, field_id_63, field_id_64, field_id_67, field_id_69, field_id_71, field_id_73, field_id_155, field_id_172, field_id_186, field_id_224, field_id_258, field_id_286, field_id_348, field_id_368, field_id_374, field_id_389, field_id_392, field_id_398, field_id_416, field_id_441, field_id_452, field_id_454, field_id_477, field_id_488, field_id_505, field_id_506, field_id_515, field_id_519, field_id_520) VALUES (9126, 3, 139, 1, ‘open’, ’ ‘, ’ ‘, ‘SENSTIVE_HTML_DATA’, ’ ‘, ”, ’ ‘, ’ ‘, ”, ’ ‘, ’ ‘, ’ ‘, ’ ‘, ’ ‘, ’ ‘, ’ ‘, ’ ‘, ’ ‘, ’ ‘, ”, ‘0.0000’, ‘0.0000’);

#7

BoldMinded (Brian)

If you were not previously using composer then don’t add it, it’ll just cause more confusion. Are any other addons you’re using have compose me files and vendor folders? If not then something is up with your environment bc this is not an issue happening for anyone else.

Look at the exp_publisher_data table to see what the column type for field 348 is, then look at the field settings in EE and see if it’s set to text, number, or whatever. Do the two match?Since you’re not sharing sensitive data I can’t help as much bc I don’t know what data type it is.

#8

Eric Harth

The only field withheld above is HTML data as specified int he comment. field_id_385 is 20th field in the statement above and is set to integer in the schema, with null as default value, but the issue is that the insert statement above is tying to insert a space character as 20th value field, which is causing the failure.

I do believe adding a vendor folder resolved the dependency errors and the sql error above is a subsequent error.

#9

BoldMinded (Brian)

Can you run the following query?

SELECT @@GLOBAL.sql_mode;

What version of MySQL?

#10

BoldMinded (Brian)

I’m running my local version of MySQL, version 5.7, in its default, strict mode and its not throwing an error when I have a field set to Integer, and the publisher_data column is set to int with default null.

set global sql_mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";
#11

Eric Harth

SQL Mode STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION

MySql version: Ver 14.14 Distrib 5.6.39

#12

Eric Harth

After changing the SQL mode using

set global sql_mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";

i’m still getting the same issue.

#13

BoldMinded (Brian)

Ok, I’m going to need CP access to look into this further, and possibly FTP access to debug while its trying to save an entry if I can’t determine anything with just CP access.

#14

Eric Harth

I’ll try to arrange something, and revert.

#15

BoldMinded (Brian)

Sounds good. When its ready please provide detailed steps to replicate, e.g. exactly what entry I need to edit, what language you’re saving in, what status to view the entry in and what status to save the entry as etc.

#16

Eric Harth

Hey Mate

I represent a large corporation hence my request to share our data/repository outside the company has been denied.

That sent me digging into your code to identify the issue. Seems there’s a non type-safe match that’s been causing this issue.

For your addon’s latest version (v2.7.9) If you look at line #250 through to #252 of the model ‘publisher_entry.php’

250:      if (in_array($field, $custom_fields) && $value != '') {
251:            $data[$field] = ($value ? "'". $db->escape_str($value) ."'" : "''");
252:      }

The first instance of expression $value on line #251 equates to false if it’s value is a string:”0”, which stores output in the data array as an empty string that subsequently causes an sql fault.

It can be fixed by either removing the check altogether or making it check explicitly for nulls as you already have checked for empty strings in line 250.

250:      if (in_array($field, $custom_fields) && $value != '') {
251:            $data[$field] = ($value !== null ? "'". $db->escape_str($value) ."'" : "''");
252:      }

Thanks

#17

BoldMinded (Brian)

Thanks for finding that. Really surprised this hasn’t been an issue until now. I’ll make that update for the next release.

Login to reply