xoops forums

Ronaldus

Friend of XOOPS
Posted on: 2008/3/21 9:08
Ronaldus
Ronaldus (Show more)
Friend of XOOPS
Posts: 389
Since: 2004/5/8 1
#1

WF Sections 2.07 PHP5 error

Hello people,

I'm preparing for a move towards PHP5.
When I access my site on my local XAMPP, with PHP 5.2.5, I get the following message:

Fatal error: Cannot redeclare WfsArticle::$groupid in D:\Xampp\htdocs\trauma\stnn\modules\wfsection\class\wfsarticle.php on line 89

On that line I read:
var $groupid = '1 2 3';

A while ago I upgraded to WFSections 2.07 because this version was supposed to be PHP 5 ready.
Now this seems to be not the case.
From version 2.07 it is NOT possible to upgrade to SmartSections 2.13, so now I'm stuck.

Any help or advice would be appreciated !!

Thx in advance and kind greetings,

zyspec

Module Developer
Posted on: 2008/3/21 16:08
zyspec
zyspec (Show more)
Module Developer
Posts: 1075
Since: 2004/9/21
#2

Re: WF Sections 2.07 PHP5 error

I haven't really looked through the code very much but it appears that you should be able to change from:
var $groupid '1 2 3';
to
private $groupid '1 2 3';


In PHP5 this will restrict direct access to the $groupid variable inside the class to other functions within the class. This could cause problems if the module developer didn't use 'restraint' and accessed $groupid directly instead of through the class. This would most likely effect permissions to the various articles/categories.

You might try the change and test it under various conditions to make sure that it looks like it's working.

Trier

Friend of XOOPS
Posted on: 2008/3/21 19:57
Trier
Trier (Show more)
Friend of XOOPS
Posts: 12
Since: 2007/3/18
#3

Re: WF Sections 2.07 PHP5 error

WF-Sections 2.92+PHP5

Ronaldus

Friend of XOOPS
Posted on: 2008/3/22 12:48
Ronaldus
Ronaldus (Show more)
Friend of XOOPS
Posts: 389
Since: 2004/5/8 1
#4

Re: WF Sections 2.92 error

I'm sorry Trier,

I tried your module, but now I get an error when I want to publish a new article, and this happens in PHP4 and PHP5...

The error is:
ErrorError while creating article

INSERT INTO xb7bfc_wfs_article articleidgroupidcategoryidweighttitlesubtitlemaintextsummaryurlurlnamecreatedpublishedexpiredusertypenohtmlnosmileynoxcodesnobreaksnotifypuballowcomuidhtmlpagepdfpageisframeofflinepagenoshowartcmainmenucounterisforumidarticleimgwrapurlversionspotlightspotlightmain VALUES 0'1 2 3 4 5'80'test doc''''test text in this document test text in this document test text in this document test text in this document '''''''120619807212061980720'admin',0001011'''' ,0000000''''1.010)

in file /modules/wfsection/class/wfsarticle.php line 478


Line 471 till 481 are:
if ( !$result $this->db->queryF$sql ) ) {
            
trigger_error$errorE_USER_ERROR );
        } else {
            
$this->articleid = ( $this->articleid ) ? $this->articleid $this->db->getInsertId();
        }


Besides this I get no blank page anymore, and I'm able to create a new section, so I think we're improving....
But I get the same error when I'm trying to update an article...

Any help is appreciated.

Thx in advance and greetings,