1

Topic: Comments does now work [Solved]

Hello.

I have managed to install Wolf CMS, and comments are enabled in admin panel.
I've added those lines to Wolf layout:

<?php
    if (Plugins::isEnabled('comment'))
    {
        if ($this->comment_status != Comment::NONE)
            $this->includeSnippet('comment-each');
        if ($this->comment_status == Comment::OPEN)
            $this->includeSnippet('comment-form');
    }
?>

however I can't see any comment forms.
After I enabled errors I can see that:

Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\wolf\wolf\Framework.php on line 68

Warning: Parameter 1 to comment_save() expected to be a reference, value given in C:\wamp\www\wolf\wolf\Framework.php on line 824

Could anyone help please?

Last edited by tikky (2009-11-03 12:28)

Re: Comments does now work [Solved]

Which PHP version do you have? 5.3?

Thumbs up

3

Re: Comments does now work [Solved]

Apache Version : 2.2.11 
PHP Version : 5.3.0 
MySQL Version : 5.1.36

Re: Comments does now work [Solved]

In Framework.php, make sure it says the following:

// No more quotes escaped with a backslash
if (PHP_VERSION < 5.3)
    set_magic_quotes_runtime(0);

This should be at line 67..  this should be fixed in the upcoming release. You may also want to change "function comment_save(&$page)" into "function comment_save($page)" in index.php of the comment plugin

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

5

Re: Comments does now work [Solved]

First proposed solution (PHP_VERSION < 5.3) mades no diffrence.

The second scenario with "function comment_save($page)" has eliminated this error:

Warning: Parameter 1 to comment_save() expected to be a reference, value given in C:\wamp\www\wolf\wolf\Framework.php on line 824

however problem still not resolved. I've tested the same CMS at http://www.opensourcecms.com and found what the problem nature is.

On my installation of WolfCMS, when I am trying to edit page from admin panel I should have a drop-down menu called "Comments". Instead of showing this menu, I'am having the error message saying:

Warning: Parameter 1 to comment_display_dropdown() expected to be a reference, value given in C:\wamp\www\wolf\wolf\Framework.php on line 824

Could you please help?

Last edited by tikky (2009-10-25 14:34)

Re: Comments does now work [Solved]

Try this... in Framework.php replace

public static function notify($event_name) {
        $args = array_slice(func_get_args(), 1); // removing event name from the arguments

        foreach(self::getObserverList($event_name) as $callback)
            call_user_func_array($callback, $args);
    }

by...

public static function notify($event_name) {
        $args = array_slice(func_get_args(), 1); // removing event name from the arguments

        foreach(self::getObserverList($event_name) as $callback) {
            $Args = array();
            foreach($args as $k => &$arg){
                $Args[$k] = &$arg;
            } 
            call_user_func_array($callback, $args);
        }
    }

I don't have PHP 5.3 available just yet so I haven't been able to test this... but it *should* work. wink

Otherwise I'm afraid you're stuck with PHP < 5.3 until after the upcoming release of 0.6.0 when I have more time to look into this.

Unless someone else on the forum is willing to look into this? wink

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

7

Re: Comments does now work [Solved]

I've managed myself to found that line (72) in index.php:

function comment_display_dropdown(&$page)

and have changed as per your last comment to:

function comment_display_dropdown($page)

This has resolved the problem with drop down list, however comments are not showing in admin panel.

Now, I've made the suggested replace in framework.php and I can properly see comments in admin panel.

Thank you for your help. I really appreciate it, and your fast response time as well.

So it was a bug? Do you want me to report it via google code, or you gonna do that?
What is suggested platform for WolfCMS, do I need PHP6?

Re: Comments does now work [Solved]

The minimum requirements are listed on this page.

It is/was not a bug as such.. PHP 5.3 is relatively new and has changed the ways in which some things work. Wolf its plugins have not (yet) been tested against PHP 5.3 so any problems that might arise from these new methods of working have not (yet) been fixed.

Testing against PHP 5.3 will be done after the 0.6.0 release so this will be resolved too.

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

9

Re: Comments does now work [Solved]

Yes, but on this page http://www.wolfcms.org/about/requirements.html I can see:
PHP: version 5 or greater

5.3 is greater then 5 ;-)
so I suggest to put information that is not tested on PHP 5.3, or suggest different PHP release.
If we want Wolf CMS to be simple, installation inof also should be clear.

Also IMHO will be nice to put Requirements info to install.txt and to that page also:
http://www.wolfcms.org/wiki/installing

10

Re: Comments does now work [Solved]

Posted as issue 95 on google code.