GNOME Bugzilla – Bug 754859
record-collection.js using depreciated function
Last modified: 2015-09-14 06:42:58 UTC
Created attachment 311107 [details] [review] Fixes error in code and page. Does not correct English explanation. This error is produced when running the record-collection.js demo. It has been present at least since Gnome 3.14. I have attached a patch that corrects the same code in the.js file and the .page file, but I am not familiar enough with the terminology to correct the tutorial itself. The fix itself is a matter of changing the statement Gda.execute***([GdaConnection],***) to [ GdaConnection].execute***(***). (gjs:2878): Gjs-WARNING **: JS ERROR: TypeError: Gda.execute_non_select_command is not a function Demo.prototype.setupDatabase@record-collection.js:75 Demo.prototype._init@record-collection.js:14 Demo@record-collection.js:7 @record-collection.js:146 JS_EvaluateScript() failed
Review of attachment 311107 [details] [review]: Thanks for the patch! ::: platform-demos/C/record-collection.js.page @@ +182,2 @@ } catch (e) { Gda.execute_non_select_command (this.connection, "create table demo (id integer, name varchar(100))"); It looks like you missed this method call.
Created attachment 311196 [details] [review] code only patch for .page and .js Does not correct this incorrect paragraph in tutorial: In order to run the SQL commands above we are using global GDA functions, execute_select_command and execute_non_select_command. They are simple to use, and just require two arguments: The Connection object and the SQL command to be parsed.
Review of attachment 311196 [details] [review]: Thanks for the patch. I pushed it to master as commit 681f100214a65e1a0675f0a403f79aed302c056b.