Possible Bug in Field Class

  • Posts: 109
  • Thank you received: 5
9 years 9 months ago #189220

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6

Hello, there.

Good evening!

The seems to be a bug in /administrator/components/com_hikashop/classes/field.php in the getFieldName function.

Instead of the current code,

function getFieldName($field,$requiredDisplay = false){

the code should be
function getFieldName($field,$requiredDisplay = true){

This will allow the asterisks next to mandatory field labels to appear correctly.

Setting the default value of $requiredDisplay to true (instead of false) is in line with the function display (in the classes/field.php file).

If you agree that this is a bug, please could you correct for the next version?

Thanks.

Take care!

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 9 months ago #189236

Hi,

I'm sorry but I have to disagree.
It will break the compatibility with overrides, current display and other extensions.
It is also a partial fix ; because you will have two asterisks in the page because the display function have also the required display parameter.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 109
  • Thank you received: 5
9 years 9 months ago #189470

Thanks, Jerome.

I changed the code and it didn't break anything.

The double asterisks is easily fixed with a change in the CSS to hide the asterisk next to the input field. For most of the sites I have seen, the mandatory asterisks are displayed next to labels and not the input fields. As it stands, to display the asterisks next to labels, Hikashop will have to change either the default value as described below or to pass in a default of true from the views (which Hikashop is currently not doing). I.e. it appears that Hikashop doesn't currently display mandatory asterisks next to labels.

Take care!

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum