[TYPO3-english] Typo3 6.2. WEC Site Config

Wiesław Golsz golsz at interia.pl
Sat May 7 23:53:39 CEST 2016


Excuse me: this frament should be as:

/function countFeatures() {//
//        global $TYPO3_DB;//
//        *if**(is_object($TYPO3_DB) && $TYPO3_DB->link) {*//
//            $table = 'tx_wecconfig_features';//
//            $res = $TYPO3_DB->exec_SELECTquery ('count(uid)', $table,
'deleted=0');//
//            $row = $TYPO3_DB->sql_fetch_assoc($res);//
//
//            $count = $row['count(uid)'];//
//        } else {//
//            $count = 0;//
//        }//
//        return $count;//
//}/


Where *line 192* is: /if(is_object($TYPO3_DB) && $TYPO3_DB->link) {//

/ERROR

Fatal error: Cannot access protected property
TYPO3\CMS\Core\Database\DatabaseConnection::$link in
/home/www/6.bestchoicefx.com/typo3conf/ext/wec_config/features/class.tx_wecconfig_features.php
on line 192

Why cannot access to database???

Regars,


On 2016-05-07 23:32, Wiesław Golsz wrote:
> OK Jigaj, but next error in this code (class.tx_wecconfig_features.php):
>
> /function countFeatures() {//
> //        global $TYPO3_DB;//
> //        //
> //            $table = 'tx_wecconfig_features';//
> //            $res = $TYPO3_DB->exec_SELECTquery ('count(uid)',
> $table, 'deleted=0');//
> //            $row = $TYPO3_DB->sql_fetch_assoc($res);//
> //
> //            $count = $row['count(uid)'];//
> //        } else {//
> //            $count = 0;//
> //        }//
> //        return $count;//
> //    }/
>
> Fatal error: Cannot access protected property
> TYPO3\CMS\Core\Database\DatabaseConnection::$link in
> /home/www/6.bestchoicefx.com/typo3conf/ext/wec_config/features/class.tx_wecconfig_features.php
> on line 192
>
> Where line 192 is: /if(is_object($TYPO3_DB) && $TYPO3_DB->link) {//
> /
>
> On 2016-05-07 22:49, Jigal van Hemert wrote:
>> Hi,
>>
>> On 07/05/2016 20:42, Wiesław Golsz wrote:
>>> This time much more serious error. I use an application developed by
>>> WEC. It is widely used in the network, but WEC support no longer
>>> exists.
>>>
>>> It is very important ext "/WEC Site Config/" Site-wide configuration
>>> module for constants, templates, and add-on features.
>>> https://typo3.org/extensions/repository/view/wec_config
>>>
>>> I get this error:
>>>
>>> /Fatal error: require_once() [function.require]: Failed opening
>>> required
>>> 'PATH_t3libclass.t3lib_extobjbase.php'
>>> (include_path='/home/www/6.bestchoicefx.com/typo3/contrib/pear/:.:/usr/local/php5.3/lib//php')
>>>
>>> in
>>> /home/www/6.bestchoicefx.com/typo3conf/ext/wec_config/features/class.tx_wecconfig_features.php
>>>
>>> on line 31/
>>
>> Most of the time these errors are not hard to fix, although it can
>> take some time if you encounter a lot of them each time you fix one.
>>
>> In TYPO3 4.3 (if I remember correctly) a mechanism was introduced to
>> automatically load classes in PHP. This meant that you didn't need to
>> use lines like
>>
>> require_once( PATH_t3libclass . 't3lib_extobjbase.php');
>>
>> in your code. You could just use the class and it would automatically
>> be loaded.
>> Many extension authors still kept those lines because the code still
>> worked. In 6.x the autoloader was changed and these errors appeared
>> if extension code still used those unnecessary lines.
>>
>>> Q3. How to fix this error
>>
>> Look carefully at the error! It says that the require_once didn't
>> work in
>> ....../ext/wec_config/features/class.tx_wecconfig_features.php on
>> line 31.
>>
>> Edit the file and put two slashes in front of the 'require_once' on
>> the mentioned line. This turns the rest of the line into a comment
>> and it will no longer be executed. It will look a bit like:
>>
>> //require_once( PATH_t3libclass . 't3lib_extobjbase.php');
>>
>> (I don't know the exact line, but you get the idea)
>>
>> Warning for the future:
>> - in 6.x all class names in the core were changed; the names are now
>> easier to read
>> - 6.2 still knows the old names like the existed in 4.5 and
>> extensions can still use the old names
>> - 7.6 doesn't know the old names anymore, but there is an extension
>> 'compatibility6' which makes it possible to still use the old class
>> names; it comes with a price, performance is a lot worse with that
>> extension installed
>> - 8.x don't know the old names and there is no extension that adds
>> support for those old class names
>>
>> You can use a lot of 4.x compatible extensions with 6.2, but it would
>> be wise to look for alternatives before upgrading to 7 LTS or 8.x.
>> Alternative would be to edit the extensions and replace all the old
>> class names with the new names. In some cases more code needs to be
>> replaced, but you could hire a TYPO3 programmer to make those changes.
>>
>>
>



More information about the TYPO3-english mailing list