Bug #9787 Duplicate

Channel entries shift channels - shared field groups

Version: EE 2.0.0b02 20091023 Reporter: Sean O'Brien

1. Field group and first channel created and associated.
2. Second and third channels are created and associated with the initial field group.
3. Content is added to all channels.
4. One or more fields are added or edited within the shared field group.
5. An entry in the second or third channel gets edited.
6. That entry moves from the channel it was created in to the first channel associated with the shared field group.

It probably goes without saying that I do not expect number 6. I have seen this error repeat several times. I’m running MSM.

  • Hrm- well, didn’t replicate yet. But in attempting to, duplicating group settings when creating a new channel doesn’t seem to be sticking.

    SO- let me go fix that. And then I’ll take another crack at duplicating this. It sounds… very odd!

    Thanks for the report- will yell back as soon as I’ve got something.

    Robin Sowell
    25th November, 2009 at 11:43am
  • K- I… replicate. Hopefully it’s the same thing going wrong in both cases. When you go to edit the entry? Look under ‘options’- I’m betting the wrong channel is selected in the ‘Channel’ dropdown.

    That’s what’s happening in mine. So- IF you switched the channel to the current channel (which should be selected automatically- and isn’t) it saves it appropriately. If you don’t- it’s going into the first channel in the list.

    That look like what’s happening for you?

    What I’m seeing is definitely a bug- and I’m on it. If that’s not the same thing happening for you, let me know. And I’ll poke it some more.

    Robin Sowell
    25th November, 2009 at 5:29pm
  • Yes, that’s it! I had no idea that there was a place where I could shift entries manually between channels, and didn’t think to look under the options tab. Awesome.

    Thank you. Sean

    Sean O'Brien
    25th November, 2009 at 7:03pm
  • Heh- it was an easy fix, but a bit quirky narrowing in on the problem. You can only shift between channels if the two (or more) channels share the same field group, cat group(s) AND status group. Otherwise, the option doesn’t even show.

    I’ve got it fixed for the next release. In the meantime, you could do a quick tweak of the controllers/cp/content_publish.php file to get it working on the beta release.

    Search for: function _build_channel_vars and then look for this bit of code:

    if (isset($_POST['new_channel']) && is_numeric($_POST['new_channel']))
                            {
                                $vars['menu_channel_selected'] = ($_POST['new_channel'] == $row['channel_id']) ? 1 : '';
                            }
                            else
                            {
                                $vars['menu_channel_selected'] = ($channel_id == $row['channel_id']) ? 1 : '';
                            }

    Er- yep. We had the selected channel hard coded. A switch to this should do the trick:

    if (isset($_POST['new_channel']) && is_numeric($_POST['new_channel']))
                            {
                                $vars['menu_channel_selected'] = ($_POST['new_channel'] == $row['channel_id']) ? $row['channel_id'] : '';
                            }
                            else
                            {
                                $vars['menu_channel_selected'] = ($channel_id == $row['channel_id']) ? $row['channel_id'] : '';
                            }

    It’s just making sure they can only switch it to a channel they have permission to access.

    Thanks again for the bug report! I’d swear I’ve tested publish a thousand times- and the little buggers still keep cropping up.

    Robin Sowell
    25th November, 2009 at 11:00pm
  • That did it! Thanks.

    Sean O'Brien
    26th November, 2009 at 3:34pm
  • Woot! And thanks for the feedback!

    Robin Sowell
    29th November, 2009 at 10:09pm
  • Hey Robin, This fix doesn’t actually seem to have worked. The channel continues to default to the first channel on edit. Now that I know how to switch channels manually, this isn’t such an urgent issue, but it’s still there.

    I double checked the replacement code you had me paste in, and it is the new code. I’m not sure why my initial indicated a fix. My testing methods may have been less than rigorous over the holiday weekend.

    Sean O'Brien
    30th November, 2009 at 9:04pm
  • Blast- I swear it worked for me- but another report here- gonna consolidate there for technical reasons and mark this duplicate. (Which is backwards, I know.)

    Robin Sowell
    03rd December, 2009 at 10:49am
  • Argh- dumb on my part! Yep, I see the circumstances that trigger the wrong default assignment. This time it really is fixed for the next build! Thanks again for your patience on this one!

    Robin Sowell
    03rd December, 2009 at 1:48pm

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases