1
SMEDrieben
Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 11:40

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


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

2
Mamba
Re: Deprecated since Xoops 2.5.4: how can solve this
  • 2011/11/27 11:52

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


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.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

3
SMEDrieben
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 12:42

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


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

4
trabis
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 16:08

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


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

5
kris_fr
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 19:40

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


Best tool is Notepad++

6
Mamba
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 20:03

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


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.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

7
SMEDrieben
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 20:41

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


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

8
SMEDrieben
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 21:05

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


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

9
trabis
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 22:16

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


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'

10
Roby73
Re: Deprecated since Xoops 2.5.4: how can I solve this
  • 2011/11/27 22:32

  • Roby73

  • Friend of XOOPS

  • Posts: 262

  • Since: 2011/6/15


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.

Login

Who's Online

488 user(s) are online (337 user(s) are browsing Support Forums)


Members: 0


Guests: 488


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits