{"id":1806,"date":"2003-09-21T00:29:20","date_gmt":"2003-09-21T00:29:20","guid":{"rendered":"http:\/\/www.soulhuntre.com\/items\/date\/2003\/09\/21\/semi-deep-dreamweaver-voodoo\/"},"modified":"2003-09-21T00:29:20","modified_gmt":"2003-09-21T00:29:20","slug":"semi-deep-dreamweaver-voodoo","status":"publish","type":"post","link":"http:\/\/legacyiamsenseiken.local\/2003\/09\/21\/semi-deep-dreamweaver-voodoo\/","title":{"rendered":"Semi-Deep Dreamweaver Voodoo…"},"content":{"rendered":"

Let’s talk tech for a moment. Recently, the cool folks over at Macromedia released the much anticipated 2004 version of Dreamweaver MX<\/a>. I have been working with the trial version of it to decide if my clients and I should upgrade – but it’s a done deal really, we should. Of course, there are some small teething problems. Read on for a tail of frustration, technical prowess and you might even find a solution or two.<\/p>\n

<\/p>\n

The first one I encountered was that DW (Dreamweaver) now requires<\/i><\/b> PHP<\/a> 4.1 if you are going to use it’s code generators with a PHP server model. Hand coded PHP is not effected. Why? Because PHP 4.1 introduced the ability to access form variables as shown below<\/a> instead of an older syntax:<\/p>\n

\n

$_POST[‘example’]<\/p>\n<\/blockquote>\n

This is a pretty significant change. Enjoy that knowledge. Let it sink in. In fact, I will say it again because you now know the secre<\/a>t that took me most of a day of debugging PHP to realize. That’s OK though, cause now I understand intimately<\/i> how DW deals with the server.<\/p>\n

\n

Dreamweaver MX2004 absolutely required PHP 4.1 or above.<\/b><\/i><\/p>\n<\/blockquote>\n

The reason for the problem is simple… DW uploads a helper script in PHP when you are using the PHP model (other types for other models) that it uses as a sort of web service or proxy to access the metadata of the database. This is a pretty good idea in a lot of ways, not the least of which is it lets you work with a locked down database your hosting provider might not want to open up for off site access via a true client tool.<\/p>\n

This web service is provided command data in the form of a post’ed [[wp:HTML]] for and returns the results as a mostly [[wp:XML]] document. I say mostly because I don’t thin it strictly conforms to all the formal requirements of a full on XML document; and herein lies the problem \ud83d\ude42<\/p>\n

So I am working on a database, the same one that I had the above mentioned PHP issue with. Time is passing and it is all going well when !!BLAM!!<\/i><\/b> another enigmatic error message without any help at all. This one came during my use of the “Insert Record Form” wizard:<\/p>\n

\n

“While executing onChange in ServerObject-InsRecPHP.htm, a JavaScript error occurred.”<\/i><\/p>\n<\/blockquote>\n

Informative huh? You have to understand that DW uses [[wp:JavaScript]] as it’s internal scripting language. A good portion of the internal functionality and much of the ability to be extended comes from this. It is a pretty cool thing, except JavaScript is a pretty odd little language. Expecting this to turn out to be some simple problem I began idly looking into the bug, tracing the DW code back through the functions, debugging and so on.<\/p>\n

\n

This took a number of very educational hours.<\/p>\n<\/blockquote>\n

The final result was be digging back into the code of the web service on the server, and finding out that there weren’t any issues I could see. It was running find and retuning the data back to DW. We could rule out a PHP error of that type.<\/p>\n

I then did the only thing an obsessive\/compulsive programmer would do that that point… I started looking at the db itself. I discovered that the functionality worked with another DB on the server and a db on another server. Honestly? I would have tried this much sooner if I hadn’t already been through the problem above with the PHP issue. Int he end, the problem lay with the returned XML:<\/p>\n

\n

DW MX can’t handle tables with a field named “length”. This bug is in both MX and MX2004.<\/b><\/i><\/p>\n<\/blockquote>\n

For your edification, the returned XML from my debugging is shown below. I had to tidy it up<\/a> some. The only difference<\/i><\/b> is the change of the field named “length” to “length_safe”.<\/p>\n

Failed XML<\/u><\/b><\/p>\n

\n
<RESULTSET>\n\t<FIELDS>\n\t\t<FIELD>\n\t\t\t<NAME>TABLE_CATALOG<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>TABLE_SCHEMA<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>TABLE_NAME<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>COLUMN_NAME<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>DATA_TYPE<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>IS_NULLABLE<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>COLUMN_SIZE<\/NAME>\n\t\t<\/FIELD>\n\t<\/FIELDS>\n\t<ROWS>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>id<\/VALUE>\n\t\t\t<VALUE>bigint<\/VALUE>\n\t\t\t<VALUE>NO<\/VALUE>\n\t\t\t<VALUE>20<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>title<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>NO<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>active<\/VALUE>\n\t\t\t<VALUE>char<\/VALUE>\n\t\t\t<VALUE>NO<\/VALUE>\n\t\t\t<VALUE>1<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>catalog<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>topic<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>length<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>target<\/VALUE>\n\t\t\t<VALUE>text<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE\/>\n\t\t<\/ROW>\n\t<\/ROWS>\n<\/RESULTSET><\/pre>\n<\/blockquote>\n

Working XML<\/b><\/u><\/p>\n

\n
<RESULTSET>\n\t<FIELDS>\n\t\t<FIELD>\n\t\t\t<NAME>TABLE_CATALOG<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>TABLE_SCHEMA<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>TABLE_NAME<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>COLUMN_NAME<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>DATA_TYPE<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>IS_NULLABLE<\/NAME>\n\t\t<\/FIELD>\n\t\t<FIELD>\n\t\t\t<NAME>COLUMN_SIZE<\/NAME>\n\t\t<\/FIELD>\n\t<\/FIELDS>\n\t<ROWS>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>id<\/VALUE>\n\t\t\t<VALUE>bigint<\/VALUE>\n\t\t\t<VALUE>NO<\/VALUE>\n\t\t\t<VALUE>20<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>title<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>NO<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>active<\/VALUE>\n\t\t\t<VALUE>char<\/VALUE>\n\t\t\t<VALUE>NO<\/VALUE>\n\t\t\t<VALUE>1<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>catalog<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>topic<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>length_safe<\/VALUE>\n\t\t\t<VALUE>varchar<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE>128<\/VALUE>\n\t\t<\/ROW>\n\t\t<ROW>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE\/>\n\t\t\t<VALUE>target<\/VALUE>\n\t\t\t<VALUE>text<\/VALUE>\n\t\t\t<VALUE>YES<\/VALUE>\n\t\t\t<VALUE\/>\n\t\t<\/ROW>\n\t<\/ROWS>\n<\/RESULTSET><\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

Let’s talk tech for a moment. Recently, the cool folks over at Macromedia released the much anticipated 2004 version of Dreamweaver MX. I have been working with the trial version of it to decide if my clients and I should upgrade – but it’s a done deal really, we should. Of course, there are some […]<\/p>\n","protected":false},"author":3,"featured_media":56252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[278],"tags":[],"_links":{"self":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/posts\/1806"}],"collection":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/comments?post=1806"}],"version-history":[{"count":0,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/posts\/1806\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/media\/56252"}],"wp:attachment":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/media?parent=1806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/categories?post=1806"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/tags?post=1806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}