[In-Commerce] Coupon cloning broken

2 views
Skip to first unread message

Alexander Obuhovich

unread,
Oct 20, 2010, 1:11:22 PM10/20/10
to In-Portal Bugs
When I try to clone coupon (I'm logged-in by admin user, not "root"), then:
  • after pressing "Clone" toolbar button I got JavaScript error, that "initCalendar" function isn't defined (that could because someone, who developed it used custom form block instead of predefined one)
  • after pressing "Save" button I got PHP error: permission mapping not defined for coup:OnApplyClone event.


--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Oct 25, 2010, 10:55:37 AM10/25/10
to In-Portal Bugs Team
Hi Alex,

I was about to try this on my end, but came across another issues when
adding a new Coupon and report it here -
http://groups.google.com/group/in-portal-bugs/browse_thread/thread/4032a058c92f6c63

I guess you were adding a product to your Discount Items and the
Entire Order, correct?

DA

On Oct 20, 12:11 pm, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> When I try to clone coupon (I'm logged-in by admin user, not "root"), then:
>
>    - after pressing "Clone" toolbar button I got JavaScript error, that
>    "initCalendar" function isn't defined (that could because someone, who
>    developed it used custom form block instead of predefined one)
>    - after pressing "Save" button I got PHP error: permission mapping not

Alexander Obuhovich

unread,
Oct 25, 2010, 1:49:53 PM10/25/10
to in-port...@googlegroups.com
That's just only 2 bugs in same section. Please proceed with independent testing after that other issue will be fixed.

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Alexander Obuhovich

unread,
Oct 25, 2010, 4:24:35 PM10/25/10
to in-port...@googlegroups.com

Dmitry A.

unread,
Jan 4, 2011, 6:25:24 PM1/4/11
to in-port...@googlegroups.com
Hi Alex,


I have been lately working on this bug and have fixed 1st part with OnApplyClone permission, but got stock with the second one (JS due to Calendar).

It seems to be a bigger issue since if you look into in-commerce/admin_templates/discounts/coupon_clone_selector.tpl you can see that it's mainly Hard-coded form with Expiration data field processed without Regional settings. This rises the question how would you recommend approaching this:

========
<td class="control-cell">
<input type="text" name="clone_exp_date" id="clone_exp_date" value="<inp2:coup_DefaultExpDate />" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.gif" size="9">
<span class="small">(mm.dd.yy)</span>
<script type="text/javascript">
initCalendar("clone_exp_date", "m.d.y");
</script>
&nbsp;<input type="text" name="clone_exp_time" id="clone_exp_time" value="<inp2:coup_DefaultExpTime />" size="9"><span class="small"> (h:mm:ss AM)</span>
<br>

</td>
===========


DA

Alexander Obuhovich

unread,
Jan 5, 2011, 2:13:42 AM1/5/11
to in-port...@googlegroups.com
If this HTML code matches "inp_edit_date_time" block code from earlier version of In-Portal (when "initCalendar" method was used), then you could just use "inp_edit_date_time" block.

However I can see, that 2 different tags DefaultExpDate and DefaultExpTime are used to display value of that field. I propose to create virtual field, that has same default value and use that field in inp_edit_date_time block.

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Alexander Obuhovich

unread,
Jan 5, 2011, 3:17:56 AM1/5/11
to in-port...@googlegroups.com
Here is the patch.

Also I've noticed, that same cloning problem could be with Gift Certificates.
coupon_cloning_problem.patch

Dmitry A.

unread,
Jan 5, 2011, 1:17:28 PM1/5/11
to in-port...@googlegroups.com
Hi,


Thanks for the patch Alex!

I have reviewed and improved your patch a bit. Please test my version.


Cheers!
coupon_cloning_problem-v3-Dmitry.patch
Reply all
Reply to author
Forward
0 new messages