Help with deprecated functions in Info Pages & other deprecated functions.

Open to all! Ask other shopowners for help.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Help with deprecated functions in Info Pages & other deprecated functions.

Post by lecarlb »

Phoenix version: 1.0.8.20
PHP version: 8.0.30

When attempting to add a new page in Info Pages, I get a screen that simply say [PHOENIX FATAL].

So I look in the error logs and find the only error relating to Info Pages

Code: Select all

[Mon Nov 13 04:42:20.664956 2023] [proxy_fcgi:error] [pid 726181:tid 139721749587520] [client 52.70.240.171:0] AH01071: Got error 'PHP message: PHP Deprecated:  The tep_db_query function has been deprecated. in /var/www/vhosts/xxxxxxxxxx.com/httpdocs/includes/functions/database.php on line 35PHP message: PHP Deprecated:  The tep_db_fetch_array function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/database.php on line 45'
 [Mon Nov 13 04:42:23.493116 2023] [proxy_fcgi:error] [pid 726181:tid 139721242039872] [client 71.28.224.173:0] AH01071: Got error 'PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxxx.com/httpdocs/adminBTDC1/includes/functions/html_output.php on line 51', referer: https://xxxxxxxxxxxx.com/adminBTDC1/info_pages.php?formid=3a7fa73a170a820e5f7acf7795ec71782c651586ea461ec9cde57bd99b14ec2d&flag=1&pID=1
 [Mon Nov 13 04:42:29.392360 2023] [proxy_fcgi:error] [pid 726209:tid 139721451726400] [client 71.28.224.173:0] AH01071: Got error 'PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxxx.com/httpdocs/adminBTDC1/includes/functions/html_output.php on line 51', referer: https://xxxxxxxxxxxx.com/adminBTDC1/info_pages.php?action=new
I didn't find anything in that file. I see the new way to do it in @raiwa 's list but I'm having difficulty finding the file.

Here are some of the other deprecated functions found along with and at the same time as the one mentioned above

Code: Select all

[Mon Nov 13 04:42:39.595364 2023] [proxy_fcgi:error] [pid 726181:tid 139720696776256] [client 71.28.224.173:0] AH01071: Got error 'ed. in /var/www/vhosts/xxxxxxxxxx.com/httpdocs/includes/functions/database.php on line 45PHP message: PHP Deprecated:  The tep_get_tax_rate function has been deprecated. in /var/www/vhosts/xxxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 123PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_image function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/image.php on line 24PHP message: PHP Deprecated:  The phoenix_normalize function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 26PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_get_tax_rate function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 123PHP message: PHP Deprecated:  The tep_get_all_get_params function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 62PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_draw_button function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 181PHP message: PHP Deprecated:  The tep_has_product_attributes function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 238PHP message: PHP Deprecated:  The tep_get_all_get_params function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 62PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_draw_button function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 181PHP message: PHP Deprecated:  The phoenix_normalize function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 26PHP message: PHP Deprecated:  The tep_db_fetch_array function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/database.php on line 45PHP message: PHP Deprecated:  The tep_get_tax_rate function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 123PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_image function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/image.php on line 24PHP message: PHP Deprecated:  The phoenix_normalize function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 26PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_get_tax_rate function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 123PHP message: PHP Deprecated:  The tep_get_all_get_params function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 62PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_draw_button function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 181PHP message: PHP Deprecated:  The tep_has_product_attributes function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 238PHP message: PHP Deprecated:  The tep_get_all_get_params function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/general.php on line 62PHP message: PHP Deprecated:  The tep_href_link function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/href_link.php on line 14PHP message: PHP Deprecated:  The tep_draw_button function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 181PHP message: PHP Deprecated:  The phoenix_normalize function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/html_output.php on line 26PHP message: PHP Deprecated:  The tep_db_fetch_array function has been deprecated. in /var/www/vhosts/xxxxxxxxxxx.com/httpdocs/includes/functions/database.php on line 45', referer: https://xxxxxxxxxxx.com/index.php?cPath=373_1925
I'll try to hunt these errors down until I can get some advisement. If I can get an example on how to fix a couple of these, that'll help. Thanks in advance.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by burt »

First place to look would be any addons that are related to info_pages.
EG: hooks.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by lecarlb »

burt wrote: Mon Nov 13, 2023 10:06 am First place to look would be any addons that are related to info_pages.
EG: hooks.
I have only one addon related to Info_pages and the hook only deals with the breadcrumb. There's also no admin files.
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by burt »

Download your site and scan it with (eg) Grepwin, looking for tep_db_query and those other old commands.
Grepwin tells you what files contain the text you are looking for.

Software such as Grepwin should be in every shopowners installed software. I use it many times a day.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by lecarlb »

burt wrote: Mon Nov 13, 2023 4:16 pm Download your site and scan it with (eg) Grepwin, looking for tep_db_query and those other old commands.
Grepwin tells you what files contain the text you are looking for.

Software such as Grepwin should be in every shopowners installed software. I use it many times a day.
Thanks for that. Downloaded Grepwin and tep_href_link is in 2 files. Now that I've located them, I need to know what to change them to. Looking at the list and trying one of the changes in the admin file, no luck.
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by burt »

The simplest option would be to post the lines of code, say 10 lines of code either way.
I am not here to build for you.
I am here to build with you. Let's help each other.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by lecarlb »

burt wrote: Mon Nov 13, 2023 5:50 pm The simplest option would be to post the lines of code, say 10 lines of code either way.
tep_href_link in admin/includes/functions/html_output.php

Code: Select all

  function phoenix_append_css($parameter, $input) {
    trigger_error('The phoenix_append_css function has been deprecated.', E_USER_DEPRECATED);
    if (isset($parameter)) {
      $pair = explode('=', $parameter, 2);
      if (isset($pair[1]) && ('class' === $pair[0])) {
        $input->append_css(trim($pair[1], '"'));
      }
    }
  }

////
// The HTML href link wrapper function
  function tep_href_link($page = '', $parameters = '', $connection = 'SSL', $add_session_id = true) {
    trigger_error('The tep_href_link function has been deprecated.', E_USER_DEPRECATED);
    return Guarantor::ensure_global('Admin')->link($page, phoenix_parameterize($parameters), $add_session_id);
  }

  function tep_catalog_href_link($page = '', $parameters = '') {
    trigger_error('The tep_catalog_href_link function has been deprecated.', E_USER_DEPRECATED);
    return Guarantor::ensure_global('Admin')->catalog($page, phoenix_parameterize($parameters));
  }

////
tep_href_link in includes/functions/href_link.php

Code: Select all

<?php
/*
  $Id$

  CE Phoenix, E-Commerce made Easy
  https://phoenixcart.org

  Copyright (c) 2021 Phoenix Cart

  Released under the GNU General Public License
*/

  function tep_href_link($page = '', $parameters = '', $connection = null, $add_session_id = true, $search_engine_safe = null) {
    trigger_error('The tep_href_link function has been deprecated.', E_USER_DEPRECATED);
    return Guarantor::ensure_global('Linker')->build($page, phoenix_parameterize($parameters), $add_session_id);
  }
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by burt »

Both of these files must contain tep_href_link, and these files must be the only ones anywhere in your site that have tep_href_link.
It is these files that are correctly writing the error to your error_log.

A different file (maybe one file, maybe more) is calling tep_href_link. Scan again, making sure you are scanning your site, not a new Phoenix.
lecarlb
Contributor
Posts: 316
Joined: Mon Oct 26, 2020 5:26 pm
Phoenix Version:
Has thanked: 48 times
Been thanked: 9 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by lecarlb »

Ok, here's a list of other files that contain tep_href_link:

Code: Select all

href_link_admin.php	799 bytes	2	includes\functions	php	ANSI	11/13/2023 1:40:19 PM
Name	Size	Matches	Path	Ext	Encoding	Date modified
tpl_cm_i_best_sellers.php	3.30 KB	4	includes\modules\content\index\templates	php	ANSI	11/13/2023 1:39:43 PM
Name	Size	Matches	Path	Ext	Encoding	Date modified
tpl_cm_in_best_sellers.php	3.16 KB	4	includes\modules\content\index_nested\templates	php	ANSI	11/13/2023 1:39:38 PM
Name	Size	Matches	Path	Ext	Encoding	Date modified
tpl_cm_ip_best_sellers.php	3.16 KB	4	includes\modules\content\index_products\templates	php	ANSI	11/13/2023 1:39:39 PM
Name	Size	Matches	Path	Ext	Encoding	Date modified
catalog_easy_populate.php	543 bytes	1	admin\includes\boxes	php	ANSI	11/13/2023 1:38:09 PM
Name	Size	Matches	Path	Ext	Encoding	Date modified
easypopulate.php	185 KB	2	admin	php	ANSI	11/13/2023 1:37:23 PM
I'm confused because I just made a new page in info_pages just 4 days ago smoothly, no issues.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Help with deprecated functions in Info Pages & other deprecated functions.

Post by Kofod95 »

lecarlb wrote: Mon Nov 13, 2023 6:52 pm tpl_cm_i_best_sellers.php [...] tpl_cm_in_best_sellers.php [...] tpl_cm_ip_best_sellers.php
Those are from one of my add-ons (app.php/addons/free_addon/best_sellers).
That one isn't updated yet, but it's not too difficult. The files are copies of the core-list, with only a slight sql-change, so you could take care of it yourself, or wait for me to upload an update that is made for newer versions of PhoenixCart.
I am, unfortuneately, a bit behind with updating my add-ons, and due to a new job, I'm pressed for time. An update will come, but I cannot guarantee when.
lecarlb wrote: Mon Nov 13, 2023 6:52 pm catalog_easy_populate.php [...] easypopulate.php
Another add-on, but not one of mine.

Neihter are related to infoPages, but the first (mine) will come from the front-end catalog, while the second probably comes when using easy populate and everytime you load the admin-menu

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply