Page 3 of 4

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 1:50 pm
by rowi
Timbalu wrote:Can you please do me a favour and check, if

serendipity_event_autotitle.php line 196

Code: Select all

$own_charset = $serendipity['smarty']->get_template_vars('head_charset');
can be used like this

Code: Select all

if (method_exists($serendipity['smarty'], 'get_template_vars')) {
    //handle with Smarty version 2
    $own_charset = $serendipity['smarty']->get_template_vars('head_charset');
} else {
    //handle with Smarty version 3 ...
    $own_charset = $serendipity['smarty']->tpl_vars['head_charset']->value;
}
instead?
Yes this solves the problem. I guess this distinction between smarty 3 and 2 a lot of problems can be solved.

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 1:58 pm
by Timbalu
rowi wrote:Microformats:
Fatal error: Uncaught exception 'SmartyException' with message 'Plugin tag "microformats_show" already registered'
Please also check into serendipity_event_microformats.php line 217 and line 245 and replace:

Code: Select all

$serendipity['smarty']->register_function('microformats_show', 'microformats_serendipity_show');
with

Code: Select all

// For Smarty 2
if (!isset($serendipity['smarty']->_plugins['function']['microformats_show'])) {
    $serendipity['smarty']->register_function('microformats_show', 'microformats_serendipity_show');
}	
// For Smarty 3
if (!isset($serendipity['smarty']->registered_plugins['function']['microformats_show'])) {
    $serendipity['smarty']->register('function', 'microformats_show', 'microformats_serendipity_show');
}
each, please.

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 2:00 pm
by Timbalu
if the later works we'll change to smarty3 first ;-)

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 2:07 pm
by Timbalu
rowi wrote:So here's the error I get with PHP 5.3 and 5.4 with Karma enabled:
Fatal error: Uncaught exception 'ErrorException' with message 'Serendipity error: explode() expects parameter 2 to be string, array given' in
Please try this in serendipity_event_karma.php line 759 and replace

Code: Select all

$uri_parts = explode('?', str_replace('&', '&', $eventData));
by this

Code: Select all

$theUri = (string)str_replace('&', '&', $eventData);
$uri_parts = explode('?', $theUri);

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 3:08 pm
by rowi
Timbalu wrote:
rowi wrote:Microformats:
Fatal error: Uncaught exception 'SmartyException' with message 'Plugin tag "microformats_show" already registered'
Please also check into serendipity_event_microformats.php line 217 and line 245 and replace:
This leads to a different error, basically a php code dumped (http://nopaste.info/ae69f1eadf.html) and this error messages at the end:
Fatal error: Uncaught exception 'ErrorException' with message 'Serendipity error: Undefined property: Serendipity_Smarty::$_plugins' in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/compat.inc.php:119
Stack trace:
#0 [internal function]: errorToExceptionHandler('Undefined prope...', 1024)
#1 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/bundled-libs/Smarty/libs/Smarty.class.php(671): trigger_error('_plugins')
#2 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/plugins/serendipity_event_microformats/serendipity_event_microformats.php(252): Smarty->__get('backend_preview', Object(serendipity_property_bag), Array, NULL)
#3 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/plugin_api.inc.php(1073): serendipity_event_microformats->event_hook('backend_preview', Array)
#4 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/functions_entries.inc.php(1195): serendipity_plugin_api::hook_event(Array, 0, true)
#5 /mounted-storage/home126/sub001/sc73540-KSFN/w in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/compat.inc.php on line 119
Edit: I'm getting this error now with the unmodified version of serendipity_event_microformats.php, too when the plugin is enabled.

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 3:13 pm
by rowi
Timbalu wrote:
rowi wrote:So here's the error I get with PHP 5.3 and 5.4 with Karma enabled:
Fatal error: Uncaught exception 'ErrorException' with message 'Serendipity error: explode() expects parameter 2 to be string, array given' in
Please try this in serendipity_event_karma.php line 759 and replace

Code: Select all

$uri_parts = explode('?', str_replace('&', '&', $eventData));
by this

Code: Select all

$theUri = (string)str_replace('&', '&', $eventData);
$uri_parts = explode('?', $theUri);
This works with PHP 5.2, 5.3 and 5.4 :D

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 3:51 pm
by Timbalu
Reply to microformat:
Please check if you really have my version with if (!isset(... ) I added a missing ! later on...
the paste tells us that microformats_show function is not smarty registered (at least this is what I expect this bunch to be ;-) ).

The karma part is fine and bad at once, since there are a lot of plugins out there not checking the 2cd parameter to be a string. Are you testing with production = debug?
Garvin, what do you think on how to handle this further?

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 4:29 pm
by Timbalu
I am totally sorry, I have made a mistake. It should be:

Code: Select all

                    if( !defined('Smarty::SMARTY_VERSION') ) {
                        // For Smarty 2
                        if (!isset($serendipity['smarty']->_plugins['function']['microformats_show'])) {
                            $serendipity['smarty']->register_function('microformats_show', 'microformats_serendipity_show');
                        }
                    } else {
                        // For Smarty 3
                        if (!isset($serendipity['smarty']->registered_plugins['function']['microformats_show'])) {
                            $serendipity['smarty']->registerPlugin('function', 'microformats_show', 'microformats_serendipity_show');
                        }
                    }
in both appearances.

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 5:05 pm
by rowi
Timbalu wrote:I am totally sorry, I have made a mistake. It should be:
Still the PHP dump and the same erro message but with sometimes different line numbers:
Fatal error: Uncaught exception 'ErrorException' with message 'Serendipity error: Undefined property: Serendipity_Smarty::$_plugins' in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/compat.inc.php:119
Stack trace:
#0 [internal function]: errorToExceptionHandler('Undefined prope...', 1024)
#1 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/bundled-libs/Smarty/libs/Smarty.class.php(671): trigger_error('_plugins')
#2 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/plugins/serendipity_event_microformats/serendipity_event_microformats.php(257): Smarty->__get('backend_preview', Object(serendipity_property_bag), Array, NULL)
#3 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/plugin_api.inc.php(1073): serendipity_event_microformats->event_hook('backend_preview', Array)
#4 /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/functions_entries.inc.php(1195): serendipity_plugin_api::hook_event(Array, 0, true)
#5 /mounted-storage/home126/sub001/sc73540-KSFN/w in /mounted-storage/home126/sub001/sc73540-KSFN/www/stdlw/s9y/include/compat.inc.php on line 119
Regarding your question about production = debug: I haven't changed any setting, just updated

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 5:22 pm
by Timbalu
Mmmhh

I did install the plugin now - and I don't really know what to do with it currently - but I don't get any errors, having these two cases including the changed lines:

Code: Select all

                case 'genpage':
                    if (!isset($serendipity['smarty'])) {
                        serendipity_smarty_init($addData);
                    }
                    include_once(dirname(__FILE__).'/smarty.inc.php');
                    $serendipity['smarty']->assign('subnode', $this->get_config('subnode') ? 1 : 0);
                    $serendipity['smarty']->assign('best', $this->get_config('best', 5.0));
                    $serendipity['smarty']->assign('step', $this->get_config('step', 1.0));
                    $serendipity['smarty']->assign('timezone', $this->get_config('timezone'));
                    if( !defined('Smarty::SMARTY_VERSION') ) {
                        // For Smarty 2
                        if (!isset($serendipity['smarty']->_plugins['function']['microformats_show'])) {
                            $serendipity['smarty']->register_function('microformats_show', 'microformats_serendipity_show');
                        }
                    } else {
                        // For Smarty 3
                        if (!isset($serendipity['smarty']->registered_plugins['function']['microformats_show'])) {
                            $serendipity['smarty']->registerPlugin('function', 'microformats_show', 'microformats_serendipity_show');
                        }
                    }
                    break;

Code: Select all

                case 'backend_preview':
                    // preview works, but content is displayed twice!!
                    if (is_array($serendipity['POST']['properties']) && count($serendipity['POST']['properties']) > 0){
                        $parr = array();
                        $supported_formats = array('hReview', 'hCalendar');
                        $supported_properties =& $this->getSupportedProperties($supported_formats);
                        foreach($supported_properties AS $prop_key => $prop_val) {
                            if (isset($serendipity['POST']['properties'][$prop_key]))
                                $eventData['properties']['mf_' . $prop_key] = $serendipity['POST']['properties'][$prop_key];
                        }
                    }
                    include_once(dirname(__FILE__).'/smarty.inc.php');
                    if (!isset($serendipity['smarty'])) {
                        serendipity_smarty_init();
                    }
                    $serendipity['smarty']->assign('subnode', ($this->get_config('subnode') ? 1 : 0));
                    if( !defined('Smarty::SMARTY_VERSION') ) {
                        // For Smarty 2
                        if (!isset($serendipity['smarty']->_plugins['function']['microformats_show'])) {
                            $serendipity['smarty']->register_function('microformats_show', 'microformats_serendipity_show');
                        }
                    } else {
                        // For Smarty 3
                        if (!isset($serendipity['smarty']->registered_plugins['function']['microformats_show'])) {
                            $serendipity['smarty']->registerPlugin('function', 'microformats_show', 'microformats_serendipity_show');
                        }
                    }
                    break;
Where do you get this error?

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 5:35 pm
by rowi
Timbalu wrote:Mmmhh

I did install the plugin now - and I don't really know what to do with it currently - but I don't get any errors, having these two cases including the changed lines:
I must make a mistake before when changing the lines, if I use your larger block everything looks fine.

Thanks for your help!

Re: [1.7] Let's get rrready to rrr … elease

Posted: Thu Jan 24, 2013 5:40 pm
by Timbalu
rowi wrote:Thanks for your help!
:-) Thank you for testing!!!
Please find more of those... (if any)!

Edit:
The issue changes have found their way into additional_plugins - available via spartacus tomorrow and into our serendipity backward compatibility smarty class, which should cover all possible plugin errors of Uncaught exception 'SmartyException' with message 'Call of unknown method 'get_template_vars' in some more plugins. If you discover this error with the RC-2 and some special plugins, you need to wait for the next candidate or copy a fresh file from our gitHub repository https://raw.github.com/s9y/Serendipity/ ... ss.inc.php.

Re: [1.7] Let's get rrready to rrr … elease

Posted: Fri Jan 25, 2013 5:52 pm
by Bla
Coming from S9Y 1.6.2 with PHP 5.2.17 everythings is fine with 1.7RC2. Thanks.

Re: [1.7] Let's get rrready to rrr … elease

Posted: Sun Feb 17, 2013 12:52 pm
by Timbalu
Just to note:
Timbalu wrote:
public s9y wrote:the following error occurs with followed links or page reloads on a local installation (OSX) updated to 1.7rc2, only direct access works well:

Code: Select all

Fatal error: Uncaught exception 'ErrorException' with message 'Serendipity error: stristr(): Empty delimiter' in /Users/me/Sites/serendipity/include/compat.inc.php:119
Stack trace:
#0 [internal function]: errorToExceptionHandler(2, 'stristr(): Empt...', '/Users/me/Sit...', 713, Array)
#1 /Users/me/Sites/serendipity/include/functions.inc.php(713): stristr('http://localhos...', '')
#2 /Users/me/Sites/serendipity/index.php(625): serendipity_track_referrer()
#3 {main}
  thrown in /Users/me/Sites/serendipity/include/compat.inc.php on line 119
[...] you have a problem with the $serendipity baseURL var or the PHP version...
garvinhicking wrote:What I find funny is that stristr() complains about an "Empty delimiter"; but stristr itself is NOT regular expression based, so it should not even have an delimiter! So yes, please tell us your PHP version, also if you have any possible PHP extensions that could overload stristr() [mb does this!] [...]
You need at least PHP 5.2.0 to run Serendipity...
public s9y wrote:So I did a second parallel installation from 1.6.2 to 1.7rc2 and everything works fine.
And when I enable „Autodetect used HTTP-Host = yes“ in my first installation, everything is fine, too.[...]
I do have some one here (possibly on all-inkl-com) with PHP 5.2.12-nmm4, who gets this stristr empty delimiter warning too. I send a PM some time ago without success to check if this is a buggy PHP version or the stristr key itself. (Debug args say: [autodetect_baseURL] => and [baseURL] => ).
I can not reach him to solve that error, but it looks like, that if needle - in this case $serendipity['baseURL'] - is empty, the warning message is an "empty delimiter" error. It seems strange how this blog has worked before...?

So please make sure you have set your Backend - configuration -> path - URL to blog, to reflect your site Url path: e.g. http://domain.com/path2S9y/

Re: [1.7] Let's get rrready to rrr … elease

Posted: Mon Feb 18, 2013 11:03 am
by public s9y
Timbalu wrote:So please make sure you have set your Backend - configuration -> path - URL to blog, to reflect your site Url path: e.g. http://domain.com/path2S9y/
I just took a look and it was empty indeed, but I don't know why. I set it with my path, set „Autodetect used HTTP-Host = no“ and everything is ok.