After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754859 - record-collection.js using depreciated function
record-collection.js using depreciated function
Status: RESOLVED FIXED
Product: gnome-devel-docs
Classification: Applications
Component: platform-demos
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-devel-docs maintainers
gnome-devel-docs maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-11 01:05 UTC by Mike Gray
Modified: 2015-09-14 06:42 UTC
See Also:
GNOME target: ---
GNOME version: 3.15/3.16


Attachments
Fixes error in code and page. Does not correct English explanation. (2.42 KB, patch)
2015-09-11 01:05 UTC, Mike Gray
none Details | Review
code only patch for .page and .js (2.55 KB, patch)
2015-09-12 03:31 UTC, Mike Gray
committed Details | Review

Description Mike Gray 2015-09-11 01:05:01 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
Comment 1 David King 2015-09-11 09:10:49 UTC
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.
Comment 2 Mike Gray 2015-09-12 03:31:40 UTC
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.
Comment 3 David King 2015-09-14 06:42:43 UTC
Review of attachment 311196 [details] [review]:

Thanks for the patch. I pushed it to master as commit 681f100214a65e1a0675f0a403f79aed302c056b.