Codoforum related discussions
new condo version breaks installation

Hi

I have reinstalled new condo version and installation breaks with following error.

Fatal error: Can't use function return value in write context in /home/xx/public_html/talking-shop/sys/CODOF/Forum/Topic.php on line 487

The admin backend works fine .

Should we revert it back to older version ?

Thanks

Hi I have reinstalled new condo version and installation breaks with following error. Fatal error: Can't use function return value in write context in /home/xx/public_html/talking-shop/sys/CODOF/Forum/Topic.php on line 487 The admin backend works fine . Should we revert it back to older version ? Thanks

It is a tiny bug caused due to an older version of PHP that does not support expressions for the empty() .

To fix it , open /home/javamazo/public_html/talking-shop/sys/CODOF/Forum/Topic.php

And replace around line 487,

    if (!empty(array_filter($allowedTags))) {

with

    if (!empty($allowedTags)) {
It is a tiny bug caused due to an older version of PHP that does not support expressions for the empty() . To fix it , open /home/javamazo/public_html/talking-shop/sys/CODOF/Forum/Topic.php And replace around line 487, if (!empty(array_filter($allowedTags))) { with if (!empty($allowedTags)) {

Hi ,

Thanks for super reply .

Its was still the same issue smile , so i have removed whole function block and its working now ... Any side effects of not having this block ???

public function filterAllowedTags($tags, $allowedTags) {

    $_tags = array();

    if (!empty(($allowedTags))){

        foreach ($tags as $tag) {

            if (in_array($tag, $allowedTags)) {

                $_tags[] = $tag;
            }
        }
    } else {

        return $tags;
    }

    return $_tags;
}
Hi , Thanks for super reply . Its was still the same issue :( , so i have removed whole function block and its working now ... Any side effects of not having this block ??? public function filterAllowedTags($tags, $allowedTags) { $_tags = array(); if (!empty(($allowedTags))){ foreach ($tags as $tag) { if (in_array($tag, $allowedTags)) { $_tags[] = $tag; } } } else { return $tags; } return $_tags; }

It should had worked with the edit from our previous post .

The method that you removed is for a future feature, but it is used by another method , so it is better you replace the entire method by

public function filterAllowedTags($tags, $allowedTags) {  
    return $tags;  
}
It should had worked with the edit from our previous post . The method that you removed is for a future feature, but it is used by another method , so it is better you replace the entire method by ``` public function filterAllowedTags($tags, $allowedTags) { return $tags; } ```

This was on a system using a quite recent version of PHP (5.4.26). Does that mean that Codoforum requires >= PHP 5.5?

No, codoforum will work in PHP 5.4 .
This error happened because we did not test the new feature added to V2.1 in older PHP versions

>This was on a system using a quite recent version of PHP (5.4.26). Does that mean that Codoforum requires >= PHP 5.5? No, codoforum will work in PHP 5.4 . This error happened because we did not test the new feature added to V2.1 in older PHP versions
179
4
0
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft