close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

CMS Adding additional values

Thread began 10/04/2012 10:15 am by Steve | Last modified 10/05/2012 3:10 pm by Steve | 600 views | 6 replies |

Steve

CMS Adding additional values

Hello,
I've added a field 'pcms2_contents.Status' to the basic database
and when working on the update page "contents_update.php" the following errors are encountered. The goal is to add a simple select list and then update the record via the insert behavior but the errors shown on the screen shot surface.

Using Design Extender 1.1.1
New release so newest files being used.

No changes have been made to the update page.

Sign in to reply to this post

Jason ByrnesWebAssist

Delete the Dreamweaver Cache file from the users configuration folder:
common_installation_issues.php

Sign in to reply to this post

Steve

Jason, you rock! That worked perfectly.

Thanks!

Sign in to reply to this post

Steve

Additional Issue

Hello,
The insert behaviour is not showing in the Server Behavior list. Why is this? What needs to change to make it recognized and allow GUI editing?

Here is the code as found. Note I did remove the blank lines as a test and that still did not allow the insert behavior to show in the Server Behavior list...

php:
<?php 

// WA Application Builder Update
if (isset($_POST["Update"])) // Trigger
{
  
$WA_connection $PowerCMSConnection;
  
$WA_table "pcms2_contents";
  
$WA_redirectURL "".(isset($_GET['returnPage'])?$_GET['returnPage']:"index.php");
  
$WA_keepQueryString false;
  
$WA_indexField "ContentID";
  
$WA_fieldNamesStr "ContentGroup|ContentRefID|ContentValue";
  
$WA_fieldValuesStr "".((isset($_POST["ContentGroup"]))?$_POST["ContentGroup"]:"")  ."" "|" "".((isset($_POST["ContentRefID"]))?$_POST["ContentRefID"]:"")  ."" "|" "".((isset($_POST["ContentValue"]))?$_POST["ContentValue"]:"")  ."";
  
$WA_columnTypesStr "',none,''|',none,''|',none,''";
  
$WA_comparisonStr "=|=|=";
  
$WA_fieldNames explode("|"$WA_fieldNamesStr);
  
$WA_fieldValues explode("|"$WA_fieldValuesStr);
  
$WA_columns explode("|"$WA_columnTypesStr);
  
  
$WA_where_fieldValuesStr "".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"")  ."";
  
$WA_where_columnTypesStr "none,none,NULL";
  
$WA_where_comparisonStr "=";
  
$WA_where_fieldNames explode("|"$WA_indexField);
  
$WA_where_fieldValues explode("|"$WA_where_fieldValuesStr);
  
$WA_where_columns explode("|"$WA_where_columnTypesStr);
  
$WA_where_comparisons explode("|"$WA_where_comparisonStr);
  
  
$WA_connectionDB $database_PowerCMSConnection;
  
mysql_select_db($WA_connectionDB$WA_connection);
  if (!
session_id()) session_start();
  
$updateParamsObj WA_AB_generateInsertParams($WA_fieldNames$WA_columns$WA_fieldValues, -1);
  
$WhereObj WA_AB_generateWhereClause($WA_where_fieldNames$WA_where_columns$WA_where_fieldValues,  $WA_where_comparisons );
  
$WA_Sql "UPDATE `" $WA_table "` SET " $updateParamsObj->WA_setValues " WHERE " $WhereObj->sqlWhereClause "";
  
$MM_editCmd mysql_query($WA_Sql$WA_connection) or die(mysql_error());
  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);
  }
}
?>
Sign in to reply to this post

Steve

I did a comparison of a new Insert against the one that does not show in the Server Behaviors panel:

php:
// WA DataAssist Insert

if (isset($_POST["Update"]) || isset($_POST["Update_x"])) // Trigger
{
  $WA_connection = $PowerCMSConnection;
  $WA_table = "pcms2_contents";
  $WA_sessionName = "SGDinsertID";
  $WA_redirectURL = "";
  if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
  $WA_keepQueryString = false;
  $WA_fieldNamesStr = "ContentGroup|ContentRefID|ContentValue|Status";
  $WA_fieldValuesStr = "".((isset($_POST["ContentGroup"]))?$_POST["ContentGroup"]:"")  ."" . $WA_AB_Split . "".((isset($_POST["ContentRefID"]))?$_POST["ContentRefID"]:"")  ."" . $WA_AB_Split . "".((isset($_POST["ContentValue"]))?$_POST["ContentValue"]:"")  ."" . $WA_AB_Split . "".((isset($_POST["selStatus"]))?$_POST["selStatus"]:"")  ."";
  $WA_columnTypesStr = "',none,''|',none,''|',none,''|none,none,NULL";
  $WA_fieldNames = explode("|", $WA_fieldNamesStr);
  $WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
  $WA_columns = explode("|", $WA_columnTypesStr);
  $WA_connectionDB = $database_PowerCMSConnection;
  mysql_select_db($WA_connectionDB, $WA_connection);
  @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($WA_connection);
  if ($WA_redirectURL != "")  {
    $WA_redirectURL = str_replace("[Insert_ID]",$_SESSION[$WA_sessionName],$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);
  }
}
?>



Is there added functionality in the default that is hand coded and not recognized by the current version of Data Bridge?

I can manually transfer the new Status insert value etc but it would be nice if all the files were editable in the various behaviors.

Sign in to reply to this post

Jason ByrnesWebAssist

it's the line for the redirect URL causing the issue.

change:

php:
$WA_redirectURL = "".(isset($_GET['returnPage'])?$_GET['returnPage']:"index.php");



to:

php:
$WA_redirectURL = "".(isset($_GET['returnPage'])?$_GET['returnPage']:"index.php")."";
Sign in to reply to this post

Steve

Thanks!

Got a couple more issues but will create a new thread in case it helps others

Sign in to reply to this post

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...