We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Custom entry tabs with custom layouts - bug or doing it wrong?

Development and Programming

Darren Miller's avatar
Darren Miller
103 posts
15 years ago
Darren Miller's avatar Darren Miller

I recently posted a bug report which has attracted some similar responses but no official confirmation. https://support.ellislab.com/bugs/detail/12983/

With the release of 2.1 my issue remains and I’m looking to firmly establish if I’m being dumb or if there is a problem.

See the problem like so: - Fresh install copy of 2.1 with sample data - Install my SEO module - Publish a new entry - notice correct new tab (see jpg 1) - Make a custom layout to remove the Pings tab and refresh layout - Notice my SEO tab no longer functions (see jpg 2) - This behaviour happens for Super Admins and new member groups

This is my first module where I’ve made an entry tab, so I’d be very happy to accept I’ve made an error - but if I have I can’t see it. I’ve attached my module so you can see the tab file. The module is very much a work in progress but the tab file should be all done.

many thanks in advance

       
sm9's avatar
sm9
352 posts
15 years ago
sm9's avatar sm9

I’m currently having the exact same issue but with the Tag module - see this thread on the Solspace forum.

Removing the Publish Layout fixes the problem, but whenever I change and save a new Publish layout, my Tags tab show up blank (as in your screenshot).

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
15 years ago
Robin Sowell's avatar Robin Sowell

K- with the SEO module? It’s a third party issue. Basically- in tab.dm_seo.php in publish_tabs:

$settings[$field] = array(
'field_id' => 'seo_'.$field,

Try that instead of ‘field_id’ => ‘dm_seo_’.$field.

What was going on- your tab array is:

$tabs['dm_seo'] = array(

            'seo_title'=> array(
                'visible'    => 'true',
                'collapse'    => 'false',
                'htmlbuttons'    => 'false',
                'width'        => '100%'
                ),

EE prefixes the fields to avoid collisions- but it strips the prefix before sending the tab file the data- so you don’t have to muck with it. Anyway- point being- the tab field is seo_title- but in the tab publish_tabs function you were looking for ‘dm_seo_title’. Er- that make sense?

I didn’t poke everything- but just tweaking that got rid of the php errors on the publish screen.

Take another poke around after making those changes and let me know how it goes. I’m going to mark the bug fixed in the tracker because I think core is ok. But if you do run into anything- I’m subscribed to this thread. And if a bug does come up- we can start a fresh bug post. Sound good?

       
Darren Miller's avatar
Darren Miller
103 posts
15 years ago
Darren Miller's avatar Darren Miller

Thanks for looking into this Robin.

I’ve made the suggested change to tab.dm_seo.php::publish_tabs(), but it’s not made any difference.

When I un-install the module, re-install and follow the checklist in the first post of this thread the fields all disappear.

To clarify: I’ve not been getting any php errors - where are you seeing them? Also, the module works exactly as expected when no custom entry form layout is applied. It’s only when a custom layout is applied and the form refreshed the the problem can be seen.

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
15 years ago
Robin Sowell's avatar Robin Sowell

Right- it’s something with the tabs that’s causing the issue. And keep in mind- I am running a new version than the release, so it is possible you’re catching an error that I’m not. (In which case- the next release should clear it up.)

That said- unedited? With a saved layout- I go install the module. Then I go to publish- and in the SEO tab I have a string of errors:

A PHP Error was encountered

Severity: Notice

Message: Undefined index: dm_seo__seo_title

Filename: content/publish.php

Line Number: 141

Loops- basically an error for each field. I make the change above? No error.

Hrm- though it blows errors when I submit:

Severity: Notice

Message: Undefined index: dm_seo_title

Filename: dm_seo/tab.dm_seo.php

Line Number: 97

Looks like a similar issue down there-

'title' => $params['mod_data']['seo_title'],
            'description' => $params['mod_data']['seo_description'],
            'keywords' => $params['mod_data']['seo_keywords'],

That’s post edit- the keys were ‘dm_seo_title’- but again, that’s not the field name from the tab.

And- after that, backend wise it seems to be working fine for me.

       
sm9's avatar
sm9
352 posts
15 years ago
sm9's avatar sm9
Right- it’s something with the tabs that’s causing the issue. And keep in mind- I am running a new version than the release, so it is possible you’re catching an error that I’m not. (In which case- the next release should clear it up.)

I guess that explains my issue with the Tag module tab then, which I mentioned above? If so, I’ll add a note to the Solspace thread to say it’s an EE issue & to wait for the next release.

Thanks.

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
15 years ago
Robin Sowell's avatar Robin Sowell

Well- no, the above issue is definitely a problem with the third party code. It’s possible that there’s a difference in the released code and the dev code that may be a contributing factor. But I definitely can’t say for sure. The test third party module was working fine w/Tabs on the release code.

In short? Two many factors to say for sure right now whether Tag has an issue or not. They definitely want to take a look at it- if it’s an issue in the core code, they’ll note it.

       
sm9's avatar
sm9
352 posts
15 years ago
sm9's avatar sm9

Thanks for confirming Robin. Will leave it with them! 😊

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
15 years ago
Robin Sowell's avatar Robin Sowell

😉 We’re hitting a fast release cycle, so if there is something up in core, it shouldn’t hang them up long. (I did tweak one thing on layouts- the delete_layout_fields function. It was choking on the publish tab array- expecting a simple single dimensional array. Now it should take either. That said- should generally be a moot issue with third party modules as they use delete_layout_tab).

Ahem. Anyway- yep. It definitely needs a closer look before deciding where the problem lies.

       
Darren Miller's avatar
Darren Miller
103 posts
15 years ago
Darren Miller's avatar Darren Miller

Hi Robin

I really wish I could re-create those PHP notices as I’d like to eliminate them from my enquires!

I’ve set my error_reporting to E_ALL, the $debug declaration to 1 in both index.php files and my $config[‘debug’] to 1, but I see nothing.

For info, I’ve traced where the layout issue begins. No data relating to my module submits to EE.publish.save_layout() - captured by /controllers/cp/content_publish.php line 173. Could the PHP notices be related to that?

       
Darren Miller's avatar
Darren Miller
103 posts
15 years ago
Darren Miller's avatar Darren Miller

IMPORTANT UPDATE!

I’ve found the bug - and it really is a bug!

Taken me hours and hours and a few beers but here’s the scoop: A modules tab description in the language file cannot contain spaces. Simple as that.

I’ve attached a simplified module to prove the point. Download and install my “Something” module, go through all the layout adding and you’ll see it works fine. Now un-install and edit the language file to change:

"something" => 'Something'

to

"something" => 'Some Thing'

Re-install the module, go through the same thing and you’ll see the failure. There’s got to be a bug in the layout_publish model or something.

Anyway, apologies if those PHP notices caused confusion but I never thought they were the root of the problem.

Look forward to your response…

       
Darren Miller's avatar
Darren Miller
103 posts
15 years ago
Darren Miller's avatar Darren Miller

I’ve just applied yesterday’s build update and the bug remains.

I’ll give this another day for you to respond and will then re-add to the bug tracker.

For info - an even simpler way to re-create this bug is to take the Ellis Lab sample “Download” module and change the description in the language file to “Down Load” instead of “Download” on line 16

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
15 years ago
Robin Sowell's avatar Robin Sowell

Dang- I didn’t get the subscription notice- likely due to smart notification. I’ll take a look this morning, Darren- let you know what I spot. Thanks for digging deep!

       
Darren Miller's avatar
Darren Miller
103 posts
15 years ago
Darren Miller's avatar Darren Miller

Have submitted a new bug report: https://support.ellislab.com/bugs/detail/13300/

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
15 years ago
Robin Sowell's avatar Robin Sowell

And- I’ll keep the replies there- but this one is fixed up for the next release.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.