Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2018-03-09 01:20:53

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

Bloke wrote #309804:

… There’s one other gotcha I forgot to mention above: Language strings are now only loaded if their event matches the current panel’s event name.

Ah, that explains the “event” comment in the zem_plugin.php.

Oops “admin” was a typo, I’ve changed it to “admin-side” viz:

#@admin-side
#@language en
adi_admin_plugin_admin => An Admin Plugin std

and still no joy. Tried using the plugin’s event to no avail. What am I missing?

Offline

#22 2018-03-09 01:31:50

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

I’ve found the issue. The language string is translated on the plugin’s event page but not in the Extensions menu.

Offline

#23 2018-03-09 01:45:36

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

… and a plugin that creates it’s own menu doesn’t get translated either (even though it’s using a standard language string):

register_tab('plugin_help','adi_plugin_help_admin',gTxt('plugin_help'));

- menu appears as “tab_plugin_help”.

Offline

#24 2018-03-09 04:22:16

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

A favour please … any chance you could initialise $textarray to an empty array on the public side as well? I’ve got a couple of plugins that’ll break websites – big time!

Offline

#25 2018-03-09 04:41:17

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

Bloke wrote #309804:

Language strings are now only loaded if their event matches the current panel’s event name.

I’m seeing strings loaded on an admin tab regardless – see following scenarios

#@some-event is missing completely
#@some-other-valid-event is used 
#@public
#@nonexistant-event

Seems to occur both with cached & installed plugins.

Offline

#26 2018-03-09 10:20:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,499
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

gomedia wrote #309811:

a plugin that creates it’s own menu doesn’t get translated

Hmm yeah that’s because tabs are in the admin-side group so they appear “everywhere” on the admin side. Bit annoying I guess to have to put just that string in the admin-side group in your plugin; hadn’t thought about that. Might have to relax the plugin string loading rules further in the interim. Will see what can be done.

gomedia wrote #309813:

any chance you could initialise $textarray to an empty array on the public side as well?

Sure, shouldn’t be an issue.

gomedia wrote #309814:

I’m seeing strings loaded on an admin tab regardless

If these strings are inside a plugin, I’d have said that it’s probably to do with the fact all non-empty owner strings are loaded on every panel. But if that was the case, you’d see the plugin’s tab string too, so maybe something’s amiss here. I’ll do some more testing over the weekend, thanks for your patience here.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#27 2018-03-09 11:12:47

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

Bloke wrote #309844:

… thanks for your patience here.

No problem – you’re doing all the work … I’m just picking holes!

BTW, have I got the syntax right? for example:

#@owner gomedia
#@admin-side
#@language en

A #@xxx by itself is an event?

Offline

#28 2018-03-09 11:13:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,499
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

gomedia wrote #309851:

BTW, have I got the syntax right? A #@xxx by itself is an event?

Yep, that’s how it’s supposed to work… let us know if it differs from this plan :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#29 2018-03-09 21:49:45

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,224
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

Bloke wrote #309794:

The language designators have all changed. Most are much shorter with only two chars.

Apologies for bombarding you with queries but I just thought of another one. Regarding the language designators, now that two character ones are being used does that mean current textpacks might not be forward compatible (i.e. TXP 4.7 is not backward compatible)? Not sure if I’m coming or going there, but hopefully you get my drift.

At the moment my current textpack that uses longer codes, for example fr-fr, seems to load successfully.

Offline

#30 2018-03-10 00:03:36

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,570
Website

Re: Fatal error when I upgrade a 4.7 dev site with plugins

gomedia wrote #309863:

Regarding the language designators, now that two character ones are being used does that mean current textpacks might not be forward compatible (i.e. TXP 4.7 is not backward compatible)?

As far as I understand it, based on what Stef mentioned in another thread, TXP 4.7 can deal with those 4 character code correctly, but the “correct“ way to specify the language code is the 2-character set.

Offline

Board footer

Powered by FluxBB