2

I already tried contact the guys from 'mighty big robot', but their support doesn't seem to be that fast and I really need to have this fixed. So I might as well try my luck over here.

So, I installed 'champagne' - http://devot-ee.com/add-ons/champagne and it works great.

It allows you to send newsletters through campaign-monitor directly from expressionengine. It also allows you to use EE's templating system to generate a template that can be use for your newsletter.

You can do this by selecting a EE-template that will be used for your newsletter in the channel you'll be using to create your newsletters. Like so:

enter image description here

Note: 'newsletter' is my channel, 'newsletter/index' is my template.

BUT, not every channel needs a newsletter. So when leaving these fields blank, like this:

enter image description here

You would expect that the 'champagne' module doesn't load when accessing the publish layout for this particular channel.
Unfortunately, it does: it ads a tab and a custom field, but they're riddled with errors and are messing up the whole publish layout. Like this:

enter image description here

I tried fixing it myself, but I just can't figure out where the module starts adding the tab and custom field.

In ft.champagne.php at line 85 it checks wether a template has been assigned to the channel and throws an error when this isn't the case.

if ( ! isset($channel_settings['html_content_url']) OR ($channel_settings['html_content_url'] == '' OR $channel_settings['text_content_url'] == ''))
{
return $this->EE->lang->line('msg_no_channel_settings');
}       
else
{
    ... 

The statement is correct: the code goes into the 'if' segment ( and stays out of the 'else' ) but it doesn't print the error, and it doesn't prevent the module from loading the tab & fields when it shouldn't.

Any ideas ?

EDIT:

nico suggested to reset the publish layout, which works. But I would rather solve this without having to reset and rebuild the publish layout of a few dozen channels.

3
  • 1
    I don't think it's a Champagne bug, I think it's EE. This has happened to me with multiple addons which add a tab to the publish page, right since the EE2 beta. Always happens when you upgrade an add-on or upgrade EE. Resetting publish layout is the only way I've found around it. Commented Mar 14, 2013 at 10:45
  • seems like it. could you post this as an answer so I can upvote ?
    – janvl
    Commented Mar 14, 2013 at 14:40
  • done, with a more thorough explanation of what I know. Commented Mar 14, 2013 at 15:59

5 Answers 5

2
+50

This looks like a bug which has plagued me since the early days of EE 2.0 beta, which is caused by a corrupted publish page layout. As far as I know, there hasn't been a fix, and I'm not even sure if there is a bug report for it.

It's quite hard to predict when it will happen. However, I've noticed these conditions are the perfect storm:

  • An add-on you have installed adds a custom tab to the publish page (EE Forums, Solspace User, Champagne etc)
  • You have customized the publish page (doesn't have to be the same channel the add-on adds a tab to)
  • You upgrade either EE or the add-on in question (doesn't happen on every upgrade, seems to happen about 50% of the time for me).

Generally, the symptoms are a completely messed up publish page, and if you are a super admin, lots of PHP errors at the top of the page like this (depending on which add-on you have installed):

A PHP Error was encountered
Severity: Notice
Message: Undefined index: rsvp__rsvp_total_seats
Filename: content/publish.php

Also sometimes javascript on the page is broken (e.g. client complains that Playa has stopped working).

Basically, the only fix I have found is to reset the publish layout. If you can still see those buttons, just use the EE interface. Otherwise, you can empty out the exp_layout_publish database table.

Now, this isn't particularly good news, since the bug is only caused when you have customized the publish layout, and re-customizing it every time you upgrade EE isn't very fun. Unfortunately, I've never spent the time to work out why this happens, or see whether it has been reported to EllisLab (I always figured it would probably take years for a fix so wouldn't be worth my time).

Because of this, I tend to avoid customizing the publish layout where possible. I've also stopped writing add-ons which add a tab to the publish page, since generally it triggers this bug and ends up with people complaining about PHP errors.

Sorry for the bad news if this is the same bug you're running into. Hopefully someone else here might know a real fix for the issue.

3

I suggest uninstalling 'Champagne', upgrade to latest version of EE, then reinstall 'Champagne'.

There was a bug in EE that was causing the Publish Layouts to error when addons added a new tab after a layout was customized.

I believe a new 'Champagne' tab will be added to each channel publish layout so you will most likely have to remove it from each layout that doesn't need it.

0

I've never used this addon but it sounds to me as though you might be running into a bug whereby addon JS is cached when it shouldn't be. If you aren't already running EE 2.5.4 or greater then an update might fix this (or you can apply the patch from the bug report manually).

1
  • that doesn't work. Resetting the publish layout helps though. But that doesn't really solve the problem. It's more a quick fix.
    – janvl
    Commented Mar 11, 2013 at 13:46
0

I did not look into actual Champagne code, but try making this change:

if ( ! isset($channel_settings['html_content_url']) OR ($channel_settings['html_content_url'] == '' OR $channel_settings['text_content_url'] == ''))
{
$tab_settings = array('string_override' => lang('msg_no_channel_settings'));
return $tab_settings;
}       
else
{
    ... 
0

Were you able to get this plugin working on EE2? The developer's blog talks as if they've gotten out of the add-on writing and supporting business (which kind of stinks, because I was looking at this as a possible quite-nice solution to the project I'm working on.)

From the blog, entry dated Mar 7 2013:

We got out of the ExpressionEngine add-on business in order to focus more on web consulting.

EDIT: Oh, wait, did a little search and found it. Champagne 2 is being supported by the different dev company.

2
  • I contacted "mightybigrobot" a week ago, haven't received any response what-so-ever.
    – janvl
    Commented Mar 18, 2013 at 7:57
  • Not dreadfully encouraging! Well, it's good to know that before I start using the plugin.
    – user800
    Commented Mar 18, 2013 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.