Multilingual plugin "forgets" default language

Found a bug? Tell us!!
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Re: Multilingual plugin "forgets" default language

Post by wesley »

Admin page is not accessible anymore with the following error:

Code: Select all

Fatal error: Call to a member function assign() on a non-object in /Library/WebServer/Documents/blog/plugins/serendipity_event_multilingual/serendipity_event_multilingual.php on line 383
I've disabled line 383 at the moment on my blog. Better to have access with broken title than no access at all.

Also, the sub-title (description) of the blog is still not properly processed for the archive page with the new version.
I added a line to process blogDescription (in addition to blogTitle) and that solved the problem on my blog.

Addendum: I cleared the cache and tested the language-switching functions. It works perfectly now for me.
I make s9y plugins, too.
My s9y blog depends on them. :)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Multilingual plugin "forgets" default language

Post by Timbalu »

Sorry. Please use 2.26, or this diff.

Code: Select all

@@ -25,11 +25,11 @@ class serendipity_event_multilingual extends serendipity_event
             'serendipity' => '1.6',
             'smarty'      => '2.6.7',
             'php'         => '4.1.0'
         ));
         $propbag->add('groups',         array('FRONTEND_ENTRY_RELATED', 'BACKEND_EDITOR'));
-        $propbag->add('version',        '2.25');
+        $propbag->add('version',        '2.26');
         $propbag->add('configuration',  array('copytext', 'placement', 'tagged_title', 'tagged_entries', 'tagged_sidebar', 'langswitch'));
         $propbag->add('event_hooks',    array(
                 'frontend_fetchentries'     => true,
                 'frontend_fetchentry'       => true,
                 'entry_display'             => true,
@@ -378,11 +378,15 @@ class serendipity_event_multilingual extends serendipity_event
 
                 case 'backend_configure':
                     if (!is_array($eventData)) {
                         return false;
                     }
+                    if (!is_object($serendipity['smarty'])) {
+                        serendipity_smarty_init();
+                    }
                     $serendipity['smarty']->assign('blogTitle', $this->strip_langs($eventData['blogTitle']));
+                    $serendipity['smarty']->assign('blogDescription', $this->strip_langs($serendipity['blogDescription']));
                     break;
 
                 case 'backend_entry_updertEntry':
                     if (isset($serendipity['POST']['no_save'])) {
                         $eventData['error'] = true;
@@ -445,10 +449,11 @@ class serendipity_event_multilingual extends serendipity_event
                         serendipity_smarty_init($serendipity['plugindata']['smartyvars']);
                     }
                     // assign lang stripped blogTitle to archive page
                     if ($serendipity['plugindata']['smartyvars']['view'] == 'archive') {
                         $serendipity['smarty']->assign('blogTitle', $this->strip_langs($serendipity['blogTitle']));
+                        $serendipity['smarty']->assign('blogDescription', $this->strip_langs($serendipity['blogDescription']));
                     }
 
                     if (!defined('Smarty::SMARTY_VERSION')) {
                         $this->tag_title(); // in Smarty 2 only
                         // check this deeply! - since at least for the non-tag banner entry_title this seems to not work here with Smarty 3 - see workaround in frontent_display
Still strange though that you haven't had an already initiated Smarty object at this point.

Ah, I noticed that clearing cache did solve this for you. Well, still better to have this check there added with 2.26.

Oh - and btw, if you have Spartacus mirrors set to GitHub you'll get the new commit 2.26 right away, if one has not updated the previous 2.25 version yet.

Oh - and another btw. Since loving tags, you may probably would like to test my freetags dev plugin. https://github.com/ophian/serendipity_e ... g/releases
Please read the changeLog file from v3.66, which shows, it was quite treated since then. :)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Re: Multilingual plugin "forgets" default language

Post by wesley »

Changing the Spartacus mirror to GitHub still yielded version 2.25 as the latest for me for some reason, so I did a manual download and stuff works flawlessly on my site. Great thanks. :)

As for the freetag plugin, I'm glad to give the most recent version (dev or otherwise) a ride, but Dev-2 has "2 commits to master since release" mentioned. That sounds like I should download from the "master" page instead of the page you linked. Would that be better?
I make s9y plugins, too.
My s9y blog depends on them. :)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Multilingual plugin "forgets" default language

Post by Timbalu »

No. Take the released zip 3.77-2 for sure, since that is the one you can just drop into!
The master repo is only ahead with a version note about this in the readme.

Code: Select all

GitHub still yielded version 2.25 as the latest
Yes, thats what you get (by version) today, tomorrow (after the xml sync) it will say 2.26. Thats why I said it'll yield 2.25, but will fetch 2.26, since that is the one already on GitHub, if pulled by this mirror. :)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
icegirl
Posts: 1
Joined: Wed Jun 15, 2016 3:26 pm

Re: Multilingual plugin "forgets" default language

Post by icegirl »

I have the same problem, and it did not help
Post Reply