v1.0.8.1 Questions / Comments / Concerns

Open to all! Ask other shopowners for help.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by ecartz »

vmn wrote: Wed Apr 07, 2021 7:04 am What is the future of the "traditional" functions?
They should stick around through 1.0.9.0 but disappear after that. I would not recommend writing code using them. They continue to exist so that people don't have to immediately rewrite all the code that is already using them.

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
marokech
Member
Posts: 9
Joined: Tue Oct 27, 2020 9:27 pm
Phoenix Version:
Has thanked: 1 time

Re: v1.0.8.1 Questions / Comments / Concerns

Post by marokech »

Nigel wrote: Mon Apr 05, 2021 2:42 pm
marokech wrote: Fri Apr 02, 2021 1:00 pm After testing a fresh install, seems not to be a core issue basically. should be an add-on related issue.
The only way to find it is to re-add the addons until you find it.
Annoying but necessary.
Edit:
In case someone is stuck with it, here is the solution:
in the languages files, setlocate should be like this:
@setlocale(LC_TIME, ['de_DE.UTF-8', 'de_DE.UTF8', 'deu_deu']);
Not like this: @setlocale(LC_ALL, ['de_DE.UTF-8', 'de_DE.UTF8', 'deu_deu']);
loop
Contributor
Posts: 253
Joined: Thu Mar 25, 2021 12:26 pm
Phoenix Version:
Has thanked: 7 times
Been thanked: 3 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by loop »

HI all
i'm not sure if it's a bug or not but:
if i want to use the function and select "0" as the default parameter it's nothing selected (as 0 seems to be "empty")
but in my array, i really have a value "0" and i want that selected

tep_draw_pull_down_menu('name', $array, "0", 'id="pProductsSkontoEnabled"')

Any ideas? (i already found out in select.php that the parameter $this->selectioni s not set if i make "0")

thank you for the help
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by ecartz »

loop wrote: Mon Apr 12, 2021 10:07 am If I want to use the function and select "0" as the default parameter it's nothing selected (as 0 seems to be "empty")
but in my array, I really have a value "0" and I want that selected

Code: Select all

tep_draw_pull_down_menu('name', $array, "0", 'id="pProductsSkontoEnabled"')
Any ideas? (I already found out in select.php that the parameter $this->selection is not set if I make "0")
Don't use tep_draw_pull_down_menu. Do use Select directly.

Code: Select all

(new Select('name', $choices, ['id' => 'pProductsSkontoEnabled']))->set_selection('0')
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by zipurman »

Just noticed /includes/system/versioned/1.0.8.1/pull_down.php

Assuming this needs to be removed as the class in that file is Input and looks like an early iteration of select?

BTW, @ecartz great job on the new classes!
zipurman
-----------
User avatar
edfaught
Member
Posts: 49
Joined: Mon Oct 26, 2020 3:22 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 2 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by edfaught »

Is there a simple replacement for tep_get_products_name()? I may be missing something but it seems to me that instantiating a product just to get its name goes a little overboard.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by ecartz »

edfaught wrote: Wed Apr 14, 2021 3:19 pm Is there a simple replacement for tep_get_products_name()? I may be missing something but it seems to me that instantiating a product just to get its name goes a little overboard.
Product::fetch_name -- usage example in the tep_get_products_name function.
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by zipurman »

Someone ( not me :lol: ) should create a substitution list for each of the old tep_ functions showing its new preferred method.
zipurman
-----------
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by ecartz »

zipurman wrote: Wed Apr 14, 2021 5:53 pm Someone ( not me :lol: ) should create a substitution list for each of the old tep_ functions showing its new preferred method.
That's rather what the compatibility functions are. The deprecation notice tells the compatibility function name and file location which shows the replacement code.

Note that in replacing tep_get_products_name, it is generally better to use the object method (Product->get('name')) than the static method. However, in the specific case of needing only the name and nothing else, there is a function for that.

If someone created one in a nice spreadsheet form, no one would read it. E.g. https://docs.google.com/spreadsheets/d/ ... 6gZ2pUNpg/ answers this specific question.
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: v1.0.8.1 Questions / Comments / Concerns

Post by zipurman »

Thanks @ecartz - the deprecation notice will work until the function are eventually removed. I agree that few people take the time to read the docs that are offered. I'll likely just add a replacement scheme in my IDE that converts old code to the new format ;)
zipurman
-----------


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