Advanced Date Picker - default value on backend

  • Posts: 195
  • Thank you received: 13
  • Hikashop Business
8 years 10 months ago #227085

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : No error message.

If the "Default today" field is set to Yes, then anytime the advanced date picker field is subsequently edited the "Default Value" defaults to today's date, or the next available date if "Waiting days" or "Hour for extra day" is configured.

This results in the Default Value being inadvertently saved if the Default Value field is not manually cleared out each time the field is edited.


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters
Attachments:

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
8 years 10 months ago #227100

Hi,

Try to change the line:

if(!empty($value) && !empty($default_value) && !empty($datepicker_options['today']) && ((int)$value == (int)$default_value)) {
to:
if(!empty($value) && !empty($default_value) && !empty($datepicker_options['today']) && $test && ((int)$value == (int)$default_value)) {

in the file plugins/hikashop/datepickerfield/datepickerfield_class.php and see if that helps.

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

  • Posts: 195
  • Thank you received: 13
  • Hikashop Business
8 years 10 months ago #227149

I've swapped out that line of code, but it had no affect on the default value field. When "Default to today" is set the Default Value field stlil auto-loads with the next available date.


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 10 months ago #227168

Hi,

When you have the "default today" setting ; you don't mind what value is display in your backend because in any case, the "today" date will be display in your backend and in your frontend.

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: 195
  • Thank you received: 13
  • Hikashop Business
8 years 10 months ago #227252

Hi Jerome -

Actually, it does matter because when the advanced date picker field is subsequently edited, and the "Default Value" field has been auto-filled with today's date, then the field is saved again and now the Default Value will remain that static date rather than updating to the actual current date.

The bug is present when the field is edited.


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters
Last edit: 8 years 10 months ago by 3by400.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 10 months ago #227291

Hi,

I am sorry but I still don't understand your point of view.

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.

Time to create page: 0.043 seconds
Powered by Kunena Forum