(1) 2 3 4 »
SMEDrieben SMEDrieben
  • Not too shy to talk
  • Not too shy to talk
  • Joined: 2009/6/17 3:10
  • Group: Registered Users
  • Posts: 142
  • Posted on: 2011/11/27 6:40
Deprecated since Xoops 2.5.4: how can I solve this #1
I upgraded from 2.5.3 to 2.5.4 using the upgrade package. My test system generates quite a lot of "deprecated" classes or functions:

'/class/xoopstory.php' is deprecated since XOOPS 2.5.4please create your own class instead.
'/class/xoopstopic.php' is deprecated since XOOPS 2.5.4please create your own class instead.
'/class/user.php' is deprecated since XOOPS 2.5.4please use 'kernel/user.php' instead.


Furthermore, I have 65 identical messages:

'Database::getInstance();' is deprecated since XOOPS 2.5.4please use 'XoopsDatabaseFactory::getDatabaseConnection();' instead.


How can I solve these messages ? What module could be the culprit ?

SME Drieben
Mamba Mamba
  • Moderator
  • Moderator
  • Joined: 2004/4/23 14:58
  • From Ohio, USA
  • Group: Webmaster Registered Users Designer Group Super Moderator
  • Posts: 10293
  • Posted on: 2011/11/27 6:52
Re: Deprecated since Xoops 2.5.4: how can solve this #2
Quote:
How can I solve these messages ? What module could be the culprit ?

Hopefully the module authors will update soon their modules. Several of the developers are now working together on the "Basic Module Pack", and those modules should have those issues solved.

If you want to solve it yourself, it all depends on the deprecated function, but many of them will be solved by simple Search & Replace in the /modules folder (using something like InfoRapid Search & Replace). For example:

Database::getInstance(); ==> XoopsDatabaseFactory::getDatabaseConnection();
/class/xoopsuser.php ==> /kernel/user.php
/class/xoopsobject.php ==> /kernel/object.php
/class/xoopsmodule.php ==> /kernel/module.php

/class/xoopstory.php and /class/xoopstopic.php will require more work. I think, it's only in News, and ZySpec is looking into it.

For the time being, you can ignore those messages. But the authors have to fix the modules before we go to XOOPS 2.6.0, otherwise they won't work there.
Please support XOOPS & DONATE
Use 2.5.8 | Debug | Requests | Bugs
SMEDrieben SMEDrieben
  • Not too shy to talk
  • Not too shy to talk
  • Joined: 2009/6/17 3:10
  • Group: Registered Users
  • Posts: 142
  • Posted on: 2011/11/27 7:42
Re: Deprecated since Xoops 2.5.4: how can I solve this #3
Thanks for your quick response !

What is your favourite Find/Search and Replace program or tool ? I still use "AF9 Replace some bytes". The disadvantage of this tool is that files in subfolders must be added manually. Are you aware of a tool that searches a module map (e.g. news) and all files in subfolders ?

Thanks !

Drieben
trabis trabis
  • Core Developer
  • Core Developer
  • Joined: 2006/9/1 14:10
  • From Portugal
  • Group: Webmaster Registered Users
  • Posts: 2253
  • Posted on: 2011/11/27 11:08
Re: Deprecated since Xoops 2.5.4: how can I solve this #4
Quote:

SMEDrieben wrote:

Are you aware of a tool that searches a module map (e.g. news) and all files in subfolders ?


As Mamba suggested, InfoRapid is pretty good, I used it lot of times:
http://www.inforapid.de/html/searchreplace.htm
kris_fr kris_fr
  • Theme Designer
  • Theme Designer
  • Joined: 2005/12/30 19:15
  • From Bretagne
  • Group: Registered Users
  • Posts: 1009
  • Posted on: 2011/11/27 14:40
Re: Deprecated since Xoops 2.5.4: how can I solve this #5
Best tool is Notepad++
Mamba Mamba
  • Moderator
  • Moderator
  • Joined: 2004/4/23 14:58
  • From Ohio, USA
  • Group: Webmaster Registered Users Designer Group Super Moderator
  • Posts: 10293
  • Posted on: 2011/11/27 15:03
Re: Deprecated since Xoops 2.5.4: how can I solve this #6
Quote:
Best tool is Notepad++

While Notepad is very good for editing, and I am using it quite often, InfoRapid Search & Replace seems to be much faster in the search/replace.

Actually, very often I am using both of them - while I am working on code in Notepad++, I don't want to have the extra search window, as it takes too much space. So having a separate search application is very handy

The only thing that I am missing is the capability to search UTF-8 characters, like the Asian/Arabic alphabets. Here Notepad++ works better, but for regular code, InfoRapid Search & Replace is excellent.
Please support XOOPS & DONATE
Use 2.5.8 | Debug | Requests | Bugs
SMEDrieben SMEDrieben
  • Not too shy to talk
  • Not too shy to talk
  • Joined: 2009/6/17 3:10
  • Group: Registered Users
  • Posts: 142
  • Posted on: 2011/11/27 15:41
Re: Deprecated since Xoops 2.5.4: how can I solve this #7
Thanks ! Notepad++ is already one of my favourites. InfoRapid Search & Replace is exactly the tool I was looking for !

It works ! Most deprecation messages have disappeared.

SMEDrieben
SMEDrieben SMEDrieben
  • Not too shy to talk
  • Not too shy to talk
  • Joined: 2009/6/17 3:10
  • Group: Registered Users
  • Posts: 142
  • Posted on: 2011/11/27 16:05
Re: Deprecated since Xoops 2.5.4: how can I solve this #8
There are some other deprecations. E.g.:

Function xoops_getLinkedUnameFromId() is deprecated, use XoopsUserUtility::getUnameFromId() instead


Simple replacement of this function generated a fatal error in wfdownloads:

Fatal error: Class 'XoopsUserUtility' not found in C:xampplitehtdocspublic_htmlmoduleswfdownloadsclassdownload.php on line 240


What should be done with:

Class 'XoopsTree' is deprecatedcheck 'XoopsObjectTree' in tree.php


Thanks !

SMEDrieben
trabis trabis
  • Core Developer
  • Core Developer
  • Joined: 2006/9/1 14:10
  • From Portugal
  • Group: Webmaster Registered Users
  • Posts: 2253
  • Posted on: 2011/11/27 17:16
Re: Deprecated since Xoops 2.5.4: how can I solve this #9
Quote:

SMEDrieben wrote:

Function xoops_getLinkedUnameFromId() is deprecated, use XoopsUserUtility::getUnameFromId() instead


Simple replacement of this function generated a fatal error in wfdownloads:

Fatal error: Class 'XoopsUserUtility' not found in C:xampplitehtdocspublic_htmlmoduleswfdownloadsclassdownload.php on line 240



On 2.5.x you need to load the class before you use it.
Please use xoops_load('XoopsUserUtility'); before making any call to it.
On 2.6.x there will be no need to load core classes, they are autoloaded.

Quote:

What should be done with:

Class 'XoopsTree' is deprecatedcheck 'XoopsObjectTree' in tree.php



It depends on the module and your developer skills. My guess is that modules using XoopsTree do not have classes extending XoopsObject. You would have to change module classes and make them 'blue' (as in blue move).

The easier way (and dirty) to remove that messages and to have your modules running, is the following:
- Copy class/xoopstree.php into your module/class folder and replace all file includes to use that new path.
- Open the file and rename 'class XoopsTree' into class 'ModulenameTree'
- Remove the xoopsLogger->addDeprecated line from the file.
- Rename XoopsTree calls into 'ModulenameTree'
Roby73 Roby73
  • Friend of XOOPS
  • Friend of XOOPS
  • Joined: 2011/6/15 17:31
  • From Torino
  • Group: Registered Users
  • Posts: 262
  • Posted on: 2011/11/27 17:32
Re: Deprecated since Xoops 2.5.4: how can I solve this #10
Quote:
/class/xoopstory.php and /class/xoopstopic.php will require more work. I think, it's only in News, and ZySpec is looking into it.


To resolve momentarily the problem i include the file xoopstory.php and xoopstopic.php in the module...
In this mode there are the problems with new xoops version?

Some modules are not supported, i do not know how as upgrade these.
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team