Page 5 of 8

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Wed Apr 07, 2021 7:45 am
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.

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Thu Apr 08, 2021 3:29 pm
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']);

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Mon Apr 12, 2021 10:07 am
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

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Mon Apr 12, 2021 3:30 pm
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')

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Tue Apr 13, 2021 7:22 pm
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!

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Wed Apr 14, 2021 3:19 pm
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.

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Wed Apr 14, 2021 5:22 pm
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.

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Wed Apr 14, 2021 5:53 pm
by zipurman
Someone ( not me :lol: ) should create a substitution list for each of the old tep_ functions showing its new preferred method.

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Wed Apr 14, 2021 6:16 pm
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.

Re: v1.0.8.1 Questions / Comments / Concerns

Posted: Wed Apr 14, 2021 6:29 pm
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 ;)