close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can't change data type from text to date in Summary or Details to database

Thread began 3/17/2010 8:29 am by anonymous | Last modified 3/23/2010 2:48 pm by Eric Mittman | 2579 views | 12 replies |

anonymous

Can't change data type from text to date in Summary or Details to database

Hi,

This seems to be an issue with Ecart 5x because these forms have alwyas worked for me. Since I upgraded to 5 the OrderDate column, which is a mysql date column, shows up in the Ecart SB as a Text type and sumbits all 0'c (000-00-00) in the Order Date fileds both in the summary and details to database server behaviors. This is a real problem for me because all of my clients are now not getting order dates!

The confirmation page has always worked with a hidden field as below:

<input type="hidden" name="orderdate" id="orderdate" value="<?php echo date("Y-m-d"); ?>" />

But since upgrading the SB sees this as a text field and I can't change it back to a Date type filed. The result is breaking all of my carts because the order dates are all 0's.

So, what do I need to do to get the SB to recognize this field as a date filed? Reformatting the database to use integer fields is not, and shouldn't have to be, an option.

Thanks for any help,

Tony

Attached Files
renew_confirm.zip
Sign in to reply to this post

Eric Mittman

I want to ensure that I have the details of the situation correct. So you have a form field on your confirm page that holds the formatted date correct? In the store order summary server behavior you are selecting this text field to bind to the date column in your orders table.

Have you checked on the value of the posted form element before it is being inserted to ensure that is contains the date properly formated like you are expecting it? Please post back and include this info, and also if you can please post back with the confirm page minus any of the sensitive details so that we can take a look at get a better idea for how the page is setup.

Sign in to reply to this post

anonymous

Problem Page

Hi Eric,

Thanks for the reply. As you'll see in the code, the hidden field named orderdate contains a formatted date. This filed has always worked before in prior versions of Ecart. I think I built this page with 4x.

The problem is that in both the add summary and add details to database server behaviors this hidden field now shows up in the SB windows at Text Type. If I change it to Date Type and save it reverts back to Text Type. It just won't allow me to change it to a Date Type. As a result the OrderDate is inserted as 0000-00-00 in the database. Obviously this is a big problem.

It started when I upgraded to version 5 and it appears to happen with all of the confirmation pages I've built with previous versions of Ecart. Again, these hidden fields have always worked fine in earlier versions and the date type was accepted.

I've attached the confirm page and a screen shot of the SB for reference. I get the same data type in the details SB.

Thanks for your quick response. I have some clients going nuts now because they have to manually add order dates.

Tony

Attached Files
renew_confirm.zip
Sign in to reply to this post

Eric Mittman

It looks like the code is looking at this value as a text value regardless. I have made an update to this page for you that should allow it to work properly and insert the date with the order. Please give this a try and let us know if it works for you. I will get a ticket opened for this so that it can be looked into further.

Attached Files
renew_confirm.zip
Sign in to reply to this post

anonymous

Thanks

Thanks. I'll give this a try and see if the dates are inserted properly. It may be tomorrow before I can get to testing it.

Tony

Sign in to reply to this post

Eric Mittman

Ok, let us know how it goes for you.

Sign in to reply to this post

anonymous

Almost

Hi,

The code changes you inserted did fix the the date type issue and it does insert the order dates. However, I still can't make any other changes to either the summary or details server behaviors without it reverting to a text type. This is a real problem with version 5.

Are there other ways to get the current date into a mysql date field that Ecart v5 will accept? I'm not stuck on the hidden field solution. It always worked in the past and this will certainly need to be addressed in an update, but for now I just need a way to be able to edit the server behaviors without breaking the inserts.

Thanks for the help and I look forward to getting this solved.

Tony

Sign in to reply to this post

anonymous

What changes did you make to get this working

Hi,

I now have 4 or 5 confirmation pages that I can't get the dates to work on. I really need to know, in the short term, what changes did you make to the file I sent earlier that made the order dates insert properly. I need to manually make these changes in the other confirm pages. Please let me know what I need to change quickly. Clients are getting quite upset about having to manually enter order dates!

Also, please fix ecart so that I can make changes to the server behaviors without it reverting back to text type instead of date type! I really need a quick fix on this. Has a ticket been openned on this or do I need to create one?

Thanks,

Tony

Sign in to reply to this post

Eric Mittman

I'm glad that the work around did the trick for you, this confirms for me what the issue is. Here is what I did on your page to get it working.

On renew_confirm.php on line 216 you have the $WA_columnTypesStr variable. This is where the change needs to be made. What I did was match up the column you were having a problem with in the $WA_fieldNamesStr variable. The OrderDate was the fourth value in the list so in the $WA_columnTypesStr I adjusted the fourth value. I changed it from ',none,'' to this none,none,NULL, here are the before and after versions of this variable:

before

php:
$WA_columnTypesStr = "none,none,NULL|',none,''|',none,''|none,none,NULL|none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|',none,''";



after

php:
$WA_columnTypesStr = "none,none,NULL|',none,''|',none,''|',none,'|none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|',none,''";



I will ensure that a proper bug is logged for this issue. If you have any trouble making these updates yourself post back with the code for the server behaviors that are on these pages and I will help you out with that.

Sign in to reply to this post

anonymous

Thanks

Thanks Eric,

So this will allow me to edit each server behavior as long as I make this change after each edit? Sounds easy enough. Please do make the formal bug report as this should really be fixed in a dot release soon.

Thanks for the help and I'll keep you posted in the event that other issues pop up.

Tony

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...