Extension, Module

Archived
Forum
(read-only)

Zenbu

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Nicolas Bottari

1 of 2
1
   

Deviant compatibility?

Support Request

fjldude
fjldude

Zenbu 1.5.3 and Deviant 1.06 don’t seem to be getting along as I expected.  The following sequence creates problems:
1) Set Deviant to return to the “Edit Entry” screen after publishing a new entry or updating an existing entry.
2)  Submit an entry.
3) Navigate to a channel in the Edit Channel Entries section.
Unfortunately, these three steps result in Zenbu no longer having control of Edit Channel Entries.  Instead, the standard EE version of Edit Channel Entries appears.  Disabling Deviant restores Zenbu functionality.

BTW, after installing Zenbu 1.5.3, my CP still seems to list it as 1.5.2.

Nicolas Bottari - Zenbu Studio
# 1
Developer
Nicolas Bottari - Zenbu Studio

Hi fjldude,

In Deviant, you should have an option to select Zenbu instead of “Edit Entry”. This will bring you back to Zenbu instead of sending you to the native EE Edit Channel Entries section after saving an entry. :)

As for the version number, I was sure I bumped the version in Zenbu’s config.php, but it seems that change wasn’t made. I’ll push a quick fix for this soon, but in the meantime you can make the change in Zenbu’s config.php file. Thanks for the heads up! :)

fjldude
# 2
fjldude

Whoa, that was a fast reply!

Indeed, there is an option to select Zenbu and it works fine as long as all channels use that option.  I was hoping, however, that I could use “Edit Entry” for some channels or universally.  It sounds like the Zenbu-Deviant compatibility doesn’t go as deep as I’d hoped. 

I’ll dig around and see if there is a relatively easy way to universally return on the Edit Entry page after submitting an entry.  If you happen to know of a solution, I’d love to hear it.

Thanks.

No worries on the Zenbu version number; I’ve already updated its config.php

Nicolas Bottari - Zenbu Studio
# 3
Developer
Nicolas Bottari - Zenbu Studio

I thought Deviant had a return option for each channel already. You could then have some channels return to “Edit Entry” (the entry form) and others return you to Zenbu. If it doesn’t do that already, let me (and/or Derek Hogue, the developer of Deviant) know :)

fjldude
# 4
fjldude

Yep, Deviant indeed has an option for each channel.  Setting some channels to return to Edit Entry and others to return to Zenbu works fine with Zenbu *until* I submit an entry.  After submission, Zenbu no longer works for Edit Channel Entries; I get the default EE behavior there instead.  Deviant continues to work as expected. Is this a Zenbu issue or a Deviant one? Or both? Or some other conflict?  I don’t know.

Nicolas Bottari - Zenbu Studio
# 5
Developer
Nicolas Bottari - Zenbu Studio

I can’t really say if it’s a Zenbu or Deviant issue. I’ll try to reproduce this on my side and see what can be done.
I also hotfixed the official download so that the Zenbu version if 1.5.3. Thanks again for the heads up ;)

fjldude
# 6
fjldude

Update: in the meantime, I’ve also discovered that my story is probably more complicated.  After disabling and removing Deviant, I can’t get my Zenbu settings to successfully save for my second MSM (total of 2 sites). I set some Zenbu settings, save them, and they dissapear immediately after saving.  Moreover, on the first site sometimes Zenbu is used for Edit Channel Entries; other times, it’s the native EE version.  It’s possible such Zenbu behavior was there after I installed Zenbu and before installing Deviant (I simply don’t remember; I didn’t do much with Zenbu for awhile).  If I get a chance, I’ll try isolating the problem and look for patterns so you have more to work with.  It’ll take awhile as I have a number of other addons and higher priorities for a bit.

fjldude
# 7
fjldude

Oops, forgot to mention that uninstalling Zenbu and re-installing doesn’t fix the problem.  One of the two MSM sites still won’t save Zenbu settings.  It seems there is a bigger MSM issue here…

fjldude
# 8
fjldude

OK, call me confused.  If I save the settings using “Copy this profile to member groups »” and choose some member groups, then both MSM sites seem to be working as expected.  This is my first time using Zenbu and I would never have guessed from the UI that using “Copy this profile to member groups »” would be so critical.

Anyhow, I will try re-installing Deviant and get back to you.

Nicolas Bottari - Zenbu Studio
# 9
Developer
Nicolas Bottari - Zenbu Studio

Thank you for all the details :)
Do you have a lot of channels in your EE installation? Your mention of some settings not saving remind me of this thread about a module called suhosin, which limits the amount of post data that can be submitted, making Zenbu only save a part of the data. I would check if you have this PHP module installed.

As for “Copy this profile to member groups”, using this feature isn’t necessary when saving data. When not using “Copy this profile to member groups”, you’re saving data only for yourself, and for the site you are currently on in the CP. Settings should be visible in the exp_zenbu_member_settings database table. :)

fjldude
# 10
fjldude

Thanks for the quick reply.  I’ve only got about 15 channels in each of the two sites. Suhosin is _not_ installed on the server.

I’ve uninstalled Zenbu and re-installed again. With Deviant uninstalled, here’s the current main problem.  The site for which I first save Zenbu settings works as expected (using the simple “Save Settings” only.  I’m NOT using “Copy this profile to member groups”).  But if I go to the other site, it will NOT save Zenbu settings (using the simple “Save Settings” only.  I’m NOT using “Copy this profile to member groups”). Moreover, the exp_zenbu_member_settings database table only has one row in it.  If I’ve saved settings for two sites, shouldn’t it have two rows?

If I then re-save both sites using “Copy this profile to member groups” and save for SuperAdmins too,  Zenbu seems to work ok, but only for awhile.  Then it gets flaky, sometimes reverting to the native EE Edit Channel Entries screen, especially after saving an entry and clicking Return to Filtered Entries.

Meanwhile, I still only have one row in exp_zenbu_member_settings.

Given this behavior, do you have some ideas on how to proceed?

 

fjldude
# 11
fjldude

One more thing.  The site_id in the single row in exp_zenbu_member_settings always remains the same.  No matter whether I re-save the first or second site, the site_id remains constant.  It has the value or whatever site was used during the first-ever saving of Zenbu settings.  I don’t know if this is the expected behavior, but thought it might be relevant.

Nicolas Bottari - Zenbu Studio
# 12
Developer
Nicolas Bottari - Zenbu Studio

Alright, I think I may have found the cause and a fix for this. In zenbu/models/zenbu_db.php, find line 227 (should contain “$this->EE->db->where(‘member_id’, $this->member_id);”), and open a line under that line and add the following:

$this->EE->db->where('site_id'$this->site_id); 

Basically Zenbu checks if the setting previously exists and updates the settings if true, or creates a new row if false. Unfortunately, site_id was not taken into account in this particular instance. The above code should add this ability. Let me know if this works for you :)

fjldude
# 13
fjldude

Nope, doesn’t work.  I can save one sites’ Zenbu settings just fine (in this case, it happened to be site_id 1).  When I try to save settings for the other site (site_id 2), I get a database error (1062) that points to line 238 (about 10 lines lower than the one I inserted).  Here’s a condensed version of the error report.  It seems that mysql doesn’t want to accept my member_id as a unique primary key in the second row of that table since the first row uses that same member_id (?)

Duplicate entry ‘1’ for key ‘PRIMARY’

INSERT INTO `exp_zenbu_member_settings` (`general_settings`, `show_fields`, `show_custom_fields`, `field_order`, `extra_options`, `member_id`, `site_id`) VALUES (‘a:4:{s:20:\“max_results_per_page\”;i:0;s:18:\“default_1st_filter\”;s:5:\“title\”;s:13:\“default_order\”;s:10:\“entry_date\”;s:12:\“default_sort\”;s:4:\“desc\”;}’, ‘a:17:{i:0;a:11:
.... and a bunch of settings not shown here…
{s:13:\“text_option_1\”;s:0:\”\”;s:13:\“text_option_2\”;s:4:\“html\”;}s:9:\“field_108\”;a:2:{s:13:\“text_option_1\”;s:0:\”\”;s:13:\“text_option_2\”;s:4:\“html\”;}}}}’, 1, ‘2’)

Filename: third_party/zenbu/models/zenbu_db.php

Line Number: 238

Nicolas Bottari - Zenbu Studio
# 14
Developer
Nicolas Bottari - Zenbu Studio

I see where this is going south… member_id shouldn’t be a primary key in MSM installs as member_id can be the same in more than one row. This should be fixed in the next version of Zenbu, but if you want I can log into your installation and do the modification for you. Basically the following database commands should remove the primary key and auto-increment on the member_id columns in exp_zenbu_member_settings:

ALTER TABLE exp_zenbu_member_settings MODIFY member_id INT NOT NULL;
ALTER TABLE exp_zenbu_member_settings DROP PRIMARY KEY

If you want to do this yourself, I strongly recommend to make a database backup first :)

fjldude
# 15
fjldude

Sorry about my slow response…  I finally had time to try it this evening. 

First I re-installed Zenbu and then used Navicat to confirm that member_id is already of type INT and the “Allow Null” box is unchecked.  To drop member_id as the primary key and to make this work, I assumed I also needed to turn off “auto increment” for member_id too. 

My initial tests as superadmin look promising. I can save zenbu settings for both sites and they continue to work as I switch between them. And exp_zenbu_member_settings now has multiple rows.  Hopefully all will stay stable as I add other member groups and sites. 

Now that Zenbu is working… I have to say WOW!  What a great add-on.  This is one of those rare add-ons that provides functionality that _really_ should be in core.

Thanks for all the help!

1 of 2
1