close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

$CKEditor_initialValue = ""; how to make this the value that was previously entered by the user?

Thread began 4/23/2015 11:41 am by Nathon Jones Web Design | Last modified 4/29/2015 11:53 am by Ray Borduin | 1199 views | 11 replies |

Nathon Jones Web Design

$CKEditor_initialValue = ""; how to make this the value that was previously entered by the user?

I would like my HTML Editor field to display the text that was entered by the user should its validation, or other validation on the same page, fail. At the moment it wipes the fields when a validation fails.

I've worked out how to do it for basic input fields, adding value="<?php echo(ValidatedField("newspreview_166","formTEXTINPUT")) ?>"

However the default value for the HTML Editor box is referenced as follows:
$CKEditor_initialValue = "";

I tried adding this:
$CKEditor_initialValue = "<?php echo(ValidatedField("newspreview_166","formTEXTAREAINPUT")) ?>";

But that throws back a syntax error.
Hope you can help, thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

$CKEditor_initialValue = "". (ValidatedField("newspreview_166","formTEXTAREAINPUT")) ."";

Sign in to reply to this post

Nathon Jones Web Design

"It appears that one of your server-side values is improperly coded. Please check this interface for inconsistencies." ...on save.

Attached. Thank you.
NJ

EDIT: Also, if validation passes, it is saving to database but not moving to the confirm page (newspreview.php).

Sign in to reply to this post

Ray BorduinWebAssist

The interface wants an extra space in that line:

$CKEditor_initialValue = "". (ValidatedField("addnews_166","formFULLTEXT"))  ."";



I can't see what would cause the redirect to not happen. I'd need FTP access to debug it. Usually it is an extra space or line break on the page, but I don't see one here... perhaps in one of the includes? Is there an error message?

Sign in to reply to this post

Nathon Jones Web Design

There is a bug with the File Manipulation > Upload File and MySQLi Insert behaviours.

When you attempt to bind the Simple Server File Name or Server File Name to your image field, in the MySQLi Insert Record > Column Bindings dialog it inserts invalid code - a random ] - to the $InsertQuery line and even if you fix it manually it reports back with this "It appears that one of your server-side values is improperly coded. Please check this interface for inconsistencies." error.

<sigh>

I've double checked the page, but I'm now getting the following errors at the foot of the form:

Warning: Unknown: open(\\VHOSTS3SHARE01\expressphpsessions$\sess_ueb25kn04i9c9tsgjip77k40s4, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (\\VHOSTS3SHARE01\expressphpsessions$) in Unknown on line 0

For this page...
http://www.nathonjones.com/templates/addnewsPHP/admin/addnews.php

I provide FTP details below so you can take a look at it.

Thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

I'm not seeing the improperly encoded message when opening that page or the server behavior for insert on it. What would I have to do to reproduce it?

The code on the page you sent looks perfectly good. The errors you are getting are server configuration issues that have nothing to do with your code.

The error message says:

  Please verify that the current setting of session.save_path is correct  



That is the problem. It looks like you are using a folder with a dollar sign in it as the session save path. That might be the problem... or it could be the permissions on that folder. Either way this is something that you will have to resolve on the server. You may want to open a trouble ticket with your hosting provider to help.

If you provide steps to reproduce the error with the Uploaded file name field then I can look into that one and make sure it gets fixed.

Sign in to reply to this post

Nathon Jones Web Design

The improperly encoded message has resolved itself following a switch off and switch back on over the weekend, however the server configuration errors remain although I think I have spotted a pattern.

If you go here and click the Add News button:
http://www.nathonjones.com/templates/addnewsPHP/admin/admin.php

You'll get a page with no error message at the foot and you can add a news item (which takes you through to the newspreview.php page).

When you get to newspreview.php it queries our database using the Session ID created by the "Save id in session as:" in the Insert Record behaviour on the previous page and it displays the correct record from the database so that part of it is working.

I have a confirm button on newspreview.php which is a WebAssist MySQLi Update Record behaviour that turns a tinyint field from 1 (True) to 2 (False) on submit. It is when you click this button that the server errors appear and it doesn't write to database.

Questions

1) What should the "Lookup value" be in the General tab of the WebAssist MySQLi Update Record behaviour dialog? I have tried setting it to both the ID field from the recordset on the page and also a hidden form field which is populated by the ID field from the recordset. Neither work

2) In the Update Record behaviour I am only updating the True/False field - should I, even though it's the primary key field, be updating the primary fey field in the database?

I think this error is related to the "Save id in session as:" feature or the WebAssist MySQLi Update Record behaviour. I'm not using any folder with a dollar sign in it as the session save path, as you describe, I am simply using the WebAssist MySQLi Update Record behaviour.

If it is choosing to use a dollar sign somewhere then my host isn't going to be able to help and, indeed, they have already responded with "this is a scripting issue".

Hoping you can help. Thank you.
NJ

EDIT: Sometimes I get this error depending on if I choose the hidden form field or the recordset ID field as the Lookup value for the Update record behaviours;

Notice: Undefined variable: rsNEWNEWS in \\nas44ent\domains\n\nathonjones.com\user\htdocs\templates\addnewsPHP\admin\newspreview.php on line 10

Fatal error: Call to a member function getColumnVal() on a non-object in \\nas44ent\domains\n\nathonjones.com\user\htdocs\templates\addnewsPHP\admin\newspreview.php on line 10

Line 10 is...
$UpdateQuery->addFilter("njnewsID", "=", "i", "".($rsNEWNEWS->getColumnVal("njnewsID")) ."");

Sign in to reply to this post

Nathon Jones Web Design

Another bug...

So, the WebAssist MySQLi Update Record incorrectly inserts itself BEFORE the recordset even if you've selected to use the recordset as the Lookup value for the ID field.

What is the point of the extensions if you constantly have to battle issues like this?

Half a day wasted on this.

EDIT: Can I log this as a bug? There is clearly something wrong with the way the MySQLi behaviour inserts itself into a page.

Sign in to reply to this post

Ray BorduinWebAssist

The way dreamweaver works, you have to give a weight to each server behavior... and that weight can't change. The weight is a number from 1-100 (recordset's have a weight of 50)... then based on the weight the server behavior is placed on the page.

We have to assign a weight to each server behavior and then DW is supposed to place it accordingly.

When it comes to an insert, there are two possible scenarios. You may want the insert to occur before the recordset... because you might want to display the results that you just inserted on the page. If you put the insert after the recordset, then the results that you inserted wouldn't be displayed because the insert took place after.

Now in your case you are inserting a value from a recordset... so you want the insert to take place after the recordset. We had to make a judgement call to decide which scenario would work by default and which would require moving the code chunk after application to the correct position. Our thoughts were that the first scenario is more common... since most people don't insert from a recordset but many display from one on the same page.. and that the second scenario is a more advanced application, so it is more reasonable that people doing that could figure out that they needed to move the insert below because they are more advanced users.

The reality is that sometimes in Dreamweaver when you need things to happen in a particular order, you need to adjust the order of the code manually. There is no way for us to fix this because it is just the way dreamweaver works. It isn't a bug. It is a limitation in the extensibility model Dreamweaver supports when applying server side code.

Sign in to reply to this post

Nathon Jones Web Design

If all of the above is the case then why, in your documentation, is there no mention of "weight"? We are left to establish this how exactly? By trial and error because we are "advanced users"? That's quite an assumption.

A simple paragraph explanation in your documentation would have saved me half a day today... "PLEASE NOTE: If you are using the WebAssist MySQLi Update Record behaviour and you are querying from a recordset be sure to check that the Update code hasn't been inserted BEFORE the recordset code otherwise it won't work"

Or is it not included in the documentation because, in effect, you are describing a scenario whereby the extension simply doesn't work without manual coding?

If most people don't insert from a recordset, does that mean that I'm doing something wrong in my approach? Or, if it's least common, what is the most common approach?

The scenario in full...

1) An Insert form adds a new record to our database table and creates a session value which is the unique ID for that record.

2) The Insert form also inserts a value of "True" (1) to a tinyint field in the same database table. That field represents "hide from display" - the 1 (true) value means that it should not be displayed on the public side of the website.

3) Upon submit, the Insert form inserts to database and re-directs to a confirmation page.

4) We use the session value described in step 1 above to query the database table on our confirmation page in order to create a recordset from which we display the newly added record's data.

5) We use an Update form on the confirmation page to change the tinyint field value, as described in step 2 above, to False (2) = the 2 value means that it SHOULD be displayed on the public side of the website.

Whilst I grasp what you're saying you seem to be withholding information about the extensions functionality, particularly in the documentation, that would be of huge help to "advanced users" like myself AND would save you heaps of time responding to the same old "it's not working" support whines on this forum, by e-mail etc. ;)

I find the approach quite odd in its nature.

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