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: Blocks not saving

Status Resolved
Add-on / Version Bloqs 3.2.0
Severity
EE Version 3.5.3

Harold Kuiper

Nov 13, 2017

Hi Brian,

Not sure if it’s a bug in Bloqs, Publisher Lite, Structure or EE3 it self but it reflects on Bloqs.
When I edit an article with existing bloqs and I double click the Save button they seem to disappear. It seems it only happens with the existing bloqs because the I add new bloqs and double click the save button they show up fine but without they earlier bloqs.

I’m getting an error but it doesn’t always show up and perhaps not related.
Error: Uncaught exception ‘Error’ with message ‘Call to a member function setSetting() on null’ in /var/www/vhosts/[domain]/cp/user/addons/bloqs/libraries/EEBlocks/Controller/PublishController.php:329

Best,
Martijn

#1

BoldMinded (Brian)

Are you double clicking the save button intentionally? What happens when you single click it?

#2

Harold Kuiper

It only happens when I double click. I normally don’t double click. Sometimes it happens and all the blocks are gone.

#3

BoldMinded (Brian)

Then don’t double click 😊

Seriously though, I’m not sure how to prevent the issue from happening. EE should already be disabling the publish button after the first click. The Bloqs add-on has been installed on the demo site. If you can login and add blocks to a channel can you reproduce the error there?

#4

Harold Kuiper

Perhaps a New Ticket worthy. The PHP error shows up when trying to view the entry revisions. (That’s were I go when I double click Save). I’ve got some bloqs with a related field and it seems to be causing the php error and thus not showing any revisions.

Best, Martijn

#5

BoldMinded (Brian)

Harold, you’re also out of date. Try upgrading to the latest version of EE and Bloqs.

#6

Harold Kuiper

I’m trying not to…. Some of the Editors/Publishers sometimes double-click.

I’m not seeing bloqs on your demo.

#7

BoldMinded (Brian)

There is a Bloqs field in the Pages channel entries now.

#8

BoldMinded (Brian)

Harold, I saw a lot of activity this morning with entries being saved. Were you ever able to replicate the issue on the demo site.

#9

Harold Kuiper

Hi Brian,

I haven’t been able to replicate it on the demo server. I’ve upgraded our dev version to the latest EE, Bloqs and Publisher Lite. Still losing the blocks.

#10

Harold Kuiper

Hi Brian,

On your demo I noticed that when you dave an entry the “blocks_block_id” remains the same for existing blocks. On our site the “blocks_block_id” seems to change every time I save. This goes for single clicks and double clicks. With Publisher Lite disabled they don’t change and the blocks don’t disappear.

Is there a big difference between Publisher and Publisher Lite in code or just disabled features?

Best, Martijn

#11

Harold Kuiper

When I add a single block with Publisher disabled and I double click Save. The block get added twice. When hitting save multiple times (ex. 10 times) the block get added 10 times.

#12

BoldMinded (Brian)

The code bases are the same.

“When I add a single block with Publisher disabled and I double click Save. The block get added twice. When hitting save multiple times (ex. 10 times) the block get added 10 times.” - I assume this is on your site and not the demo site? If that is the case then you’ll have to make a db backup and start disabling other add-ons one at a time until the behavior stops, then hopefully that may reveal an add-on conflict, then we’ll know where to look for the issue.

#13

Harold Kuiper

Hi Brian,

Yes that was on our demo site.

I’ve now also updated the Publisher version to the latest without results. But perhaps something went wrong cause I’m getting an error in the CP when accessing Publisher Lite > general > approval.

“SQLSTATE[HY000]: General error: 1096 No tables used:SELECT * ORDER BY group_id, group_title ee/legacy/database/drivers/mysqli/mysqli_connection.php:122”

I’ve also tested it on a version locally with EE3.5.11, Blocks 3.2.0 and Publisher Lite 2.6.5 and no other modules installed. Here the blocks also disappear. I’ll update blocks and run one more test but I think we can rule out other add-on conflicts other then Publisher and Blogs.

The difference with the “blocks_block_id” on our site and your site doesn’t mean anything?

Cheers, Martijn

#14

BoldMinded (Brian)

The block_id should change when saving when Publisher is installed. I see that it isn’t changing on the demo site, and I’m not sure why, but locally they change. Locally and on the demo site I repeatedly hit the save button and it does not duplicate blocks.

That SQL error should be followed by a stack trace… can you take a screenshot or copy/paste the full stack trace? (you may have to click a link on the error page to display it)

#15

BoldMinded (Brian)

What confuses me about the duplicated blocks when repeatedly hitting the save button is EE, by default, disables the save button, so it literally should not be able to be clicked more than once, which is why I was wondering if another add-on or some existing javascript error was appearing on the page, thus preventing the submit button from disabling itself.

#16

Harold Kuiper

Here’s the stack trace.

0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(137): CI_DB_mysqli_connection->query(‘SELECT *\nORDER …’)

1 ee/legacy/database/DB_driver.php(297): CI_DB_mysqli_driver->_execute(‘SELECT *\nORDER …’)

2 ee/legacy/database/DB_driver.php(203): CI_DB_driver->simple_query(‘SELECT *\nORDER …’)

3 ee/legacy/database/DB_active_rec.php(1219): CI_DB_driver->query(‘SELECT *\nORDER …’)

4 user/addons/publisher/Service/Member.php(120): CI_DB_active_record->get()

5 user/addons/publisher/Controllers/General/Approval.php(65): BoldMinded\Publisher\Service\Member->getMemberGroups()

6 user/addons/publisher/mcp.publisher.php(141): BoldMinded\Publisher\Controllers\General\Approval->render(‘general/approva…’)

7 user/addons/publisher/mcp.publisher.php(84): Publisher_mcp->runController()

8 [internal function]: Publisher_mcp->general(‘approval’)

9 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1660): call_user_func_array(Array, Array)

10 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(920): EllisLab\ExpressionEngine\Controller\Addons\Addons->getModuleSettings(‘publisher’, ‘general’, Array)

11 [internal function]: EllisLab\ExpressionEngine\Controller\Addons\Addons->settings(‘publisher’, ‘general’, ‘approval’)

12 ee/EllisLab/ExpressionEngine/Core/Core.php(189): call_user_func_array(Array, Array)

13 ee/EllisLab/ExpressionEngine/Core/Core.php(94): EllisLab\ExpressionEngine\Core\Core->runController(Array)

14 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))

15 public_html/admin.php(143): require_once(‘…’)

15 public_html/admin.php(143): require_once(‘…’)

#17

Harold Kuiper

On your demo I can hit the save button repeatedly without the Submit button getting disabled.

#18

BoldMinded (Brian)

Harold, have you tried a different browser or computer? Do you have any toolbars or things in your browser that could be interfering? Can you take a video of what you’re seeing?

#19

BoldMinded (Brian)

Comment has been marked private.

#20

Harold Kuiper

Hi Brian,

Multiple browsers and computers all the same.

I’ll make an vid and send it to you

#21

Harold Kuiper

Comment has been marked private.

#22

BoldMinded (Brian)

You’re saving as draft, what happens if you save as published/open?

Those buttons should also be changing style after being clicked: https://www.dropbox.com/s/qqtfzj2lj590xfy/Screenshot 2017-11-16 09.35.25.png?dl=0

#23

Harold Kuiper

When I set both View and Save as Published they disappear. When View is Draft and Save as Published they remain but Draft doesn’t sync with Published. And it should sync. I’m not getting the disabled buttons. I don’t get them on your demo either.

#24

BoldMinded (Brian)

The disabled button state may be a Safari bug b/c I don’t see it either. I’m going to talk to EL and see if there is anything they’re doing to prevent double submissions.

#25

BoldMinded (Brian)

Comment has been marked private.

#26

Harold Kuiper

Hi Brian,

I’m getting an fatal error with the latest build. This happens when trying to add or edit entries.

Fatal error: Uncaught Error: Call to a member function setSetting() on null in /sites/clean.dev/system/user/addons/bloqs/libraries/EEBlocks/Controller/PublishController.php:330 Stack trace:

0 /sites/clean.dev/system/user/addons/bloqs/libraries/EEBlocks/Controller/PublishController.php(295): EEBlocks\Controller\PublishController->publishAtom(NULL, Object(EEBlocks\Model\AtomDefinition), ”, NULL, ”)

1 /sites/clean.dev/system/user/addons/bloqs/libraries/EEBlocks/Controller/PublishController.php(123): EEBlocks\Controller\PublishController->createBlockDefinitionsVars(”, Array)

2 /sites/clean.dev/system/user/addons/bloqs/ft.bloqs.php(166): EEBlocks\Controller\PublishController->displayField(”, Array, Array)

3 /sites/clean.dev/system/ee/legacy/fieldtypes/EE_Fieldtype.php(359): Bloqs_ft->display_field(NULL)

4 /sites/clean.dev/system/ee/legacy/libraries/api/Api_ch in /sites/clean.dev/system/user/addons/bloqs/libraries/EEBlocks/Controller/PublishController.php on line 330

Best, Martijn

#27

BoldMinded (Brian)

I’ve gotten that error before as well, but it was when it was trying to load a fieldtype that did not exist. In my case an EE2 site upgraded to EE3 did not have the Nolan fieldtype installed b/c it was not EE3 compatible, thus the error.

Did you try this on other channels? Does this happen for all entries, or just existing ones, or when creating new ones?

To see what fieldtype it can’t load add this before line 330:

if ($fieldtype === null) {
    var_dump($atomDefinition);
}
#28

Harold Kuiper

On the clean install bloqs is only used on one channel. It happened when I try to add or edit entries. The var_dump shows a field which is a text field. I’m not using any special fieldtypes on the clean install. I did delete and rename some fields while testing but that was before I tried the build. When I try to open the Bloqs settings > edit block. I get the following: Fatal error: Uncaught Error: Call to a member function displaySettings() on null in /sites/clean.dev/system/user/addons/bloqs/mcp.bloqs.php:375 Stack trace:

0 /sites/clean.dev/system/user/addons/bloqs/mcp.bloqs.php(314): Bloqs_mcp->getAtomDefinitionSettingsForm(Object(EEBlocks\Model\AtomDefinition), ‘text’, NULL)

1 /sites/clean.dev/system/user/addons/bloqs/mcp.bloqs.php(267): Bloqs_mcp->getAtomDefinitionView(Object(EEBlocks\Model\AtomDefinition), NULL, Array)

2 /sites/clean.dev/system/user/addons/bloqs/mcp.bloqs.php(207): Bloqs_mcp->getAtomDefinitionsView(Object(EEBlocks\Model\BlockDefinition), Array)

3 [internal function]: Bloqs_mcp->blockdefinition()

4 /sites/clean.dev/system/ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1660): call_user_func_array(Array, Array)

5 /sites/clean.dev/system/ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.ph in /sites/clean.dev/system/user/addons/bloqs/mcp.bloqs.php on line 375

#29

BoldMinded (Brian)

If you drop in the previous version of Bloqs without changing anything in the CP or database it still throws those errors or they go away?

#30

BoldMinded (Brian)

Comment has been marked private.

#31

Harold Kuiper

Hi Brian,

This one seems to work fine. I haven’t been able to duplicate or remove blocks with the double click. Will do some more testing this week. Cheers, Martijn

#32

BoldMinded (Brian)

Good to hear 😊

#33

BoldMinded (Brian)

Harold, just an update on this. I’m removing this fix to prevent duplicate submission b/c its actually causing more problems than its fixing. I haven’t had any other reports of double clicks causing a problem, and Bloqs was like this all the way back to EE2. If you’re still having problems with this then you’ll just need to educate your content editors to not double click the save button.

Login to reply