EE compatibility updates:

  • Publisher is EE5 compatible, but it does not currently support the Fluid field.

ExpressionEngine.com licenses:

  • 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: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘kub_ee.exp_publisher_data_field_70’ doesn’t exist:

Status Resolved
Add-on / Version Publisher 3.2.2
Severity
EE Version 5.2.3

Elli Pratt

Jan 21, 2021

We are updating addons in our EE installation.
When we update publisher to the latest version 3.2.2 from version 2.11.2,  we are unable to get to the admin area or site.
It appears that the addon didn’t run it’s migration to the new database schema.

This error is received on the site:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kub_ee.exp_publisher_data_field_70' doesn't exist:
SELECT `ct`.*, `t`.*, `channel_title`, `c`.`channel_name`, `c`.`channel_url`, `c`.`comment_url`, `c`.`comment_moderate`, `c`.`channel_html_formatting`, `c`.`channel_allow_img_urls`, `c`.`channel_auto_link_urls`, `c`.`comment_system_enabled`, `username`, `m`.`email`, `m`.`screen_name`, `m`.`signature`, `m`.`sig_img_filename`, `m`.`sig_img_width`, `m`.`sig_img_height`, `m`.`avatar_filename`, `m`.`avatar_width`, `m`.`avatar_height`, `m`.`photo_filename`, `m`.`photo_width`, `m`.`photo_height`, `m`.`group_id`, `m`.`member_id`, `ct`.`url_title` AS default_url_title, `ct`.`status` AS status, `t`.`title` AS title, `t`.`site_id` AS entry_site_id, `exp_publisher_data_field_70`.`field_id_70` AS field_id_70, `exp_publisher_data_field_71`.`field_id_71` AS field_id_71, `exp_publisher_data_field_72`.`field_id_72` AS field_id_72, `exp_publisher_data_field_73`.`field_id_73` AS field_id_73, `exp_publisher_data_field_74`.`field_id_74` AS field_id_74, `exp_publisher_data_field_75`.`field_id_75` AS field_id_75, `exp_publisher_data_field_76`.`field_id_76` AS field_id_76 FROM (`exp_publisher_titles` AS t) JOIN `exp_channel_titles` AS ct ON `ct`.`entry_id` = `t`.`entry_id` JOIN `exp_channels` AS c ON `c`.`channel_id` = `t`.`channel_id` LEFT JOIN `exp_publisher_data_field_70` ON `t`.`entry_id` = `exp_publisher_data_field_70`.`entry_id` AND t.lang_id = exp_publisher_data_field_70.lang_id AND t.status = exp_publisher_data_field_70.status AND exp_publisher_data_field_70.is_fluid = 0 LEFT JOIN `exp_publisher_data_field_71` ON `t`.`entry_id` = `exp_publisher_data_field_71`.`entry_id` AND t.lang_id = exp_publisher_data_field_71.lang_id AND t.status = exp_publisher_data_field_71.status AND exp_publisher_data_field_71.is_fluid = 0 LEFT JOIN `exp_publisher_data_field_72` ON `t`.`entry_id` = `exp_publisher_data_field_72`.`entry_id` AND t.lang_id = exp_publisher_data_field_72.lang_id AND t.status = exp_publisher_data_field_72.status AND exp_publisher_data_field_72.is_fluid = 0 LEFT JOIN `exp_publisher_data_field_73` ON `t`.`entry_id` = `exp_publisher_data_field_73`.`entry_id` AND t.lang_id = exp_publisher_data_field_73.lang_id AND t.status = exp_publisher_data_field_73.status AND exp_publisher_data_field_73.is_fluid = 0 LEFT JOIN `exp_publisher_data_field_74` ON `t`.`entry_id` = `exp_publisher_data_field_74`.`entry_id` AND t.lang_id = exp_publisher_data_field_74.lang_id AND t.status = exp_publisher_data_field_74.status AND exp_publisher_data_field_74.is_fluid = 0 LEFT JOIN `exp_publisher_data_field_75` ON `t`.`entry_id` = `exp_publisher_data_field_75`.`entry_id` AND t.lang_id = exp_publisher_data_field_75.lang_id AND t.status = exp_publisher_data_field_75.status AND exp_publisher_data_field_75.is_fluid = 0 LEFT JOIN `exp_publisher_data_field_76` ON `t`.`entry_id` = `exp_publisher_data_field_76`.`entry_id` AND t.lang_id = exp_publisher_data_field_76.lang_id AND t.status = exp_publisher_data_field_76.status AND exp_publisher_data_field_76.is_fluid = 0 JOIN `exp_members` AS m ON `m`.`member_id` = `t`.`author_id` WHERE `t`.`entry_id` IN (1818) AND `t`.`status` = 'open' AND `t`.`lang_id` = 1

The addon area has what seems to be just generic warnings:

Notice
Use of undefined constant BASE - assumed 'BASE'
ee/legacy/core/URI.php, line 333

Severity: E_NOTICE
Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)
ee/legacy/libraries/Functions.php, line 393

Severity: E_WARNING
#1

BoldMinded (Brian)

Jan 21, 2021

Elli, can you provide more information? What is the rest of the stack trace around that query? It should show what methods were called prior to that and lines of code etc, which will be helpful. Can you also describe what process you took… when did this happen? Did you run Publisher’s updates or did this happen immediately after logging into EE 5 for the first time? I don’t have much context to work with… the more you can provide the better. Thanks.

#2

Elli Pratt

Jan 21, 2021

Before this, we updated our assets, structure, and low_search addons.
These addons updated successfully.

When upgrading publisher,
- We first copied all of the files from the publisher zip on top of the existing files (in appropriate locations). This is where the below text showed up.
- For sanity, I did then delete the entire addon folder and copied the files in just in case there was erroneous files.

There was no other action beyond copying the files for the installation.

(exception text posted in another reply)

#3

Elli Pratt

Jan 21, 2021

Here is the stack trace:

Stack Trace: Please include when reporting this error
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('SELECT `ct`.*, ...')
#1 ee/legacy/database/DB_driver.php(270): CI_DB_mysqli_driver->_execute('SELECT `ct`.*, ...')
#2 ee/legacy/database/DB_driver.php(180): CI_DB_driver->simple_query('SELECT `ct`.*, ...')
#3 user/addons/publisher/Service/Entry/EntryQuery.php(231): CI_DB_driver->query('SELECT `ct`.*, ...')
#4 user/addons/publisher/Service/Entry/EntryResult.php(502): BoldMinded\Publisher\Service\Entry\EntryQuery->getResultArray()
#5 user/addons/publisher/Service/Entry/EntryResult.php(220): BoldMinded\Publisher\Service\Entry\EntryResult->getAllQuery(Array, Array)
#6 user/addons/publisher/ext.publisher.php(869): BoldMinded\Publisher\Service\Entry\EntryResult->getAll(Array, Array)
#7 ee/legacy/libraries/Extensions.php(222): Publisher_ext->channel_entries_query_result(Object(Channel), Array)
#8 ee/legacy/libraries/Extensions.php(117): EE_Extensions->call_class('Publisher_ext', 'channel_entries…', Array, Array)
#9 ee/EllisLab/Addons/channel/mod.channel.php(2779): EE_Extensions->call('channel_entries…', Object(Channel), Array)
#10 ee/EllisLab/Addons/channel/mod.channel.php(281): Channel->parse_channel_entries()
#11 ee/legacy/libraries/Template.php(1847): Channel->entries()
#12 ee/legacy/libraries/Template.php(1482): EE_Template->process_tags()
#13 ee/legacy/libraries/Template.php(578): EE_Template->tags()
#14 ee/legacy/libraries/Template.php(234): EE_Template->parse('{!-- ra:0000000…', false, 1, false)
#15 ee/legacy/libraries/Template.php(165): EE_Template->fetch_and_parse('', Array, false)
#16 ee/legacy/libraries/Core.php(661): EE_Template->run_template_engine('', '')
#17 ee/legacy/controllers/ee.php(63): EE_Core->generate_page()
#18 [internal function]: EE->index()
#19 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
#20 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#21 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#22 index.php(173): require_once('ee/...')
#22 index.php(173): require_once('ee/...')
#4

BoldMinded (Brian)

Jan 21, 2021

So that error is happening on the front-end? You should login to the CP first, then run the module upgrades.

#5

Elli Pratt

Jan 21, 2021

That’s what I was thinking, but when the addon files were copied over, the admin page becomes inaccessible.

This is all that is shown in the login page. Just a blank screen with warnings.

Notice
Use of undefined constant BASE - assumed 'BASE'
ee/legacy/core/URI.php, line 333

Severity: E_NOTICE
Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)
ee/legacy/libraries/Functions.php, line 393

Severity: E_WARNING
#6

Elli Pratt

Jan 21, 2021

I would also like to add that we tried a quick upgrade to EE 5.4.0 to see if the issue was EE, but the issue still appeared.

#7

BoldMinded (Brian)

Jan 21, 2021

The first 2 errors are just notices, they shouldn’t stop anything from processing. There was nothing displayed below “Severity: E_WARNING”?

#8

BoldMinded (Brian)

Jan 21, 2021

Wait, never mind. I misread that. The headers already sent is the Severity: E_WARNING error.

#9

BoldMinded (Brian)

Jan 21, 2021

What other add-ons do you have installed?

#10

Elli Pratt

Jan 21, 2021

Here are the other addons -
Assets, Low Search, Structure, Wygwam, cache buster,  JSON Encode, LDAP authentication, Mo Variables, SEO Lite, Snippets Sync, Streeng

#11

BoldMinded (Brian)

Jan 21, 2021

You don’t need Snippet Sync in EE 3+, it’s basically native functionality now. FYI.

Make this update and see if it fixes anything. ext.publisher.php, line 2173 or so you should see this:

if ($ping->shouldPing()) {

Change it to this:

if ($ping->shouldPing() && defined('BASE')) {
#12

Elli Pratt

Jan 21, 2021

Good to know. Thanks! We will remove it.

The fix does not resolve the issue. The same error appears.

#13

BoldMinded (Brian)

Jan 21, 2021

I’ve seen this happen before… something is trying to perform a redirect but EE’s core URI library needs to use the BASE constant, but it isn’t defined yet.

Try adding this to the URI.php file, line 352 or so.

if (!defined('BASE')) {
          var_dump(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5)); die;
            }

#14

Elli Pratt

Jan 22, 2021

Here is what was printed out:

array(5) { [0]=> array(5) { ["file"]=> string(45) "/app/system/ee/legacy/libraries/Functions.php" ["line"]=> int(357) ["function"]=> string(8) "reformat" ["class"]=> string(6) "EE_URI" ["type"]=> string(2) "->" } [1]=> array(5) { ["file"]=> string(51) "/app/system/user/addons/publisher/ext.publisher.php" ["line"]=> int(2204) ["function"]=> string(8) "redirect" ["class"]=> string(12) "EE_Functions" ["type"]=> string(2) "->" } [2]=> array(5) { ["file"]=> string(51) "/app/system/user/addons/publisher/ext.publisher.php" ["line"]=> int(2165) ["function"]=> string(15) "validateLicense" ["class"]=> string(13) "Publisher_ext" ["type"]=> string(2) "->" } [3]=> array(5) { ["file"]=> string(51) "/app/system/user/addons/publisher/ext.publisher.php" ["line"]=> int(332) ["function"]=> string(20) "validateInstallation" ["class"]=> string(13) "Publisher_ext" ["type"]=> string(2) "->" } [4]=> array(5) { ["file"]=> string(46) "/app/system/ee/legacy/libraries/Extensions.php" ["line"]=> int(222) ["function"]=> string(9) "core_boot" ["class"]=> string(13) "Publisher_ext" ["type"]=> string(2) "->" } }
#15

BoldMinded (Brian)

Jan 22, 2021

Thanks for that var dump. Based on what I see there, the changes I suggested earlier should work.

if ($ping->shouldPing() && defined(‘BASE’)) {

It’s trying to redirect you to the license entry page.

Try moving it down a little further to the 2nd conditional:

if (
                defined('BASE') &&
                ($response !== null && isset($response['status'])) &&
                (!$this->setting->get('license') || $response['status'] === 'invalid')
            ) {
#16

Elli Pratt

Jan 22, 2021

I still received the same message.

I did some messing around I observed that if I remove the “validateLicense” function I still had the same error.
I went to the next function “validateInstallComplete” and my observations our in comments below.

private function validateInstallComplete()
    {
        if ($this->setting->get('install_complete') || !$this->session->isUpgraded()) {
            return;
        }
        //die; - This renders a white screen for the CP login page
        ee()->functions->redirect(
            ee('CP/URL')->make('addons/settings/publisher/utilities/install-step-two&begin=yes&limit;='. Migration::MAX_IMPORT_ENTRIES)
        );
        //die; - This shows the messages given earlier
    }

Would I be correct in thinking the issue is the redirect line?

#17

BoldMinded (Brian)

Jan 22, 2021

Ahh, forgot about that function. Try changing it to this:

if (!defined('BASE') || $this->setting->get('install_complete') || !$this->session->isUpgraded()) {
            return;
        }
#18

Elli Pratt

Jan 22, 2021

Success!! I was able to login to the CP and finish the upgrade.

Thank you much!

#19

BoldMinded (Brian)

Jan 22, 2021

Awesome! Sorry for the ordeal :(

I’ll make sure this change makes it into the next release.

Login to reply