close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Issue with redirects after insert/update in 2.0.8

Thread began 12/21/2010 1:09 pm by Dave Buchholz | Last modified 2/17/2014 6:53 pm by anonymous | 24705 views | 70 replies |

Dave BuchholzBeta Tester

Issue with redirects after insert/update in 2.0.8

I have gone in to add some new functionality to an existing site on my local test server using DA 2.0.8 (previous pages used 2.0.7) and I am having an issue with the redirect.

This is my insert behaviour code which redirect to details.php?insert=true but instead redirects to details.php?insert=true

php:
<?php 
// WA Application Builder Insert
if (!($totalRows_rsProduct == 0)) // Trigger
{
  
$WA_connection $connDB;
  
$WA_table "tbl_overstock";
  
$WA_sessionName "tbl_overstock_id";
  
$WA_redirectURL "details.php?insert=true";
  if (
function_exists("rel2abs")) $WA_redirectURL $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
  
$WA_keepQueryString false;
  
$WA_indexField "id";
  
$WA_fieldNamesStr "productID|title|details|image|price|saleprice|colour|sizing|prodtype|categoryID|subcategoryID|prodtypeID|genderID|sizeID|colorID|tstampinsert|dateinsert|admininsert|publish|sortorder|notes";
  
$WA_fieldValuesStr "".$row_rsProduct['productID']  ."" "|" "".$row_rsProduct['product']  ."" "|" "".((($row_rsProduct['genderID'] != "3")?$row_rsProduct['gender']:'').' '.$row_rsProduct['subcategory'].'<br />'.$row_rsProduct['prodtype']  ."")  ."" "|" "".$overstockImage  ."" "|" "".((isset($_POST["price"]))?$_POST["price"]:"")  ."" "|" "".((isset($_POST["saleprice"]))?$_POST["saleprice"]:"")  ."" "|" "".$row_rsProduct['color']  ."" "|" "".$row_rsProduct['size']  ."" "|" "".$row_rsProduct['prodtype']  ."" "|" "".$row_rsProduct['categoryID']  ."" "|" "".$row_rsProduct['subcategoryID']  ."" "|" "".$row_rsProduct['prodtypeID']  ."" "|" "".$row_rsProduct['genderID']  ."" "|" "".$row_rsProduct['sizeID']  ."" "|" "".$row_rsProduct['colorID']  ."" "|" "".time()  ."" "|" "".date('Y-m-d'time())  ."" "|" "".$_SESSION['adminID']  ."" "|" "".((isset($_POST["publish"]))?$_POST["publish"]:"")  ."" "|" "".((isset($_POST["sortorder"]))?$_POST["sortorder"]:"")  ."" "|" "".((isset($_POST["notes"]))?$_POST["notes"]:"")  ."";
  
$WA_columnTypesStr "none,none,NULL|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NULL|none,none,NULL|none,none,NULL|none,none,NULL|none,none,NULL|',none,NULL|none,none,NULL|',none,''";
  
$WA_fieldNames explode("|"$WA_fieldNamesStr);
  
$WA_fieldValues explode("|"$WA_fieldValuesStr);
  
$WA_columns explode("|"$WA_columnTypesStr);
  
$WA_connectionDB $database_connDB;
  
mysql_select_db($WA_connectionDB$WA_connection);
  if (!
session_id()) session_start();
  
$insertParamsObj WA_AB_generateInsertParams($WA_fieldNames$WA_columns$WA_fieldValues, -1);
  
$WA_Sql "INSERT INTO `" $WA_table "` (" $insertParamsObj->WA_tableValues ") VALUES (" $insertParamsObj->WA_dbValues ")";
  
$MM_editCmd mysql_query($WA_Sql$WA_connection) or die(mysql_error());
  
$_SESSION[$WA_sessionName] = mysql_insert_id();
  if (
$WA_redirectURL != "")  {
    if (
$WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
      
$WA_redirectURL .= ((strpos($WA_redirectURL'?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
    }
    
header("Location: ".$WA_redirectURL);
  }
}
?>



If I comment out this line:

php:
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";



everything works as it should.

This site does not use the framebuilder extension by the way.

Sign in to reply to this post

Ray BorduinWebAssist

It must have the rel2abs function defined somewhere besides the framework builder, since the code shouldn't run if the function rel2abs isn't defined like it is in the framework library.php file.

My guess is that there is an older version of that function that isn't working properly. I'll try to call you in my morning tomorrow to look into it with you.

Sign in to reply to this post
Did this help? Tips are appreciated...

Dave BuchholzBeta Tester

Ray,

FYI having done a site wide search this morning the only two files in the site where the rel2abs function exists are:

WA_DataAssist/library.php
webassist/caching/CachedResize_Image.php

and of these only the WA_DataAssist/library.php is drawn into the pages where I am having issues.

Sign in to reply to this post

Ray BorduinWebAssist

What happens if you update that file with this version?

Attached Files
library.zip
Sign in to reply to this post
Did this help? Tips are appreciated...

Dave BuchholzBeta Tester

The redirect works as expected with the new library file, thanks Ray

Sign in to reply to this post

p_vouers282571

I have exactly the same problem with the new release. I am still using dw8 so there are no framework issues.
Wish I would have seen the fix with the comment out, I just uninstalled 2.08and put 2.07 back on and it worked fine.

Sign in to reply to this post

Dave BuchholzBeta Tester

Just to follow this up, if you replace the library file found at WA_DataAssist/library.php with the one that Ray kindly supplied you will find that next time you open the wizard it will be overwritten with the incorrect version.

The answer is to replace the library file found in these locations (Mac only perhaps someone could provide the equivalent windows location) with the new one Ray attached to this thread.

CS4
/Users/USERNAME/Library/Application Support/Adobe/Dreamweaver CS4/en_US/Configuration/shared/WebAssist/ApplicationBuilder/Helpers/library.php

CS5
/Users/USERNAME/Library/Application Support/Adobe/Dreamweaver CS5/en_US/Configuration/Shared/WebAssist/ApplicationBuilder/Helpers/library.php

This will ensure when you reopen the wizard the correct library file is written to WA_DataAssist/library.php

Hope that helps

Sign in to reply to this post

neilo

Windows Machines:

C:\Users\YOURUSERNAME\AppData\Roaming\Adobe\Dreamweaver CS4\en_US\Configuration\Shared\WebAssist\ApplicationBuilder\Helpers\library.php
C:\Users\YOURUSERNAME\AppData\Roaming\Adobe\Dreamweaver CS5\en_US\Configuration\Shared\WebAssist\ApplicationBuilder\Helpers\library.php

Sign in to reply to this post

Andrew Read

Known issue - please. :)

Can this library file and this issue get posted to the known issues for this extension? Again, a sticky here in the forums with a list of the known issues and a link to their fixes would be great. :)

Sign in to reply to this post

Ray BorduinWebAssist

I have made this thread sticky. We'll try to get it updated in the extension soon as well so that these steps won't be necessary.

Sign in to reply to this post
Did this help? Tips are appreciated...
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...