Missing Table-Prefix
YAFA - June 8, 2007 - 00:27
| Project: | Notepad |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | jondoesdrupal |
| Status: | closed |
Jump to:
Description
Hi,
within your module, Line 487:
$result = db_query("SELECT n.nid, n.title, n.created, n.changed, s.node_type, m.priority FROM node n INNER JOIN {notepad_nodes} s ON n.nid=s.node_id INNER JOIN {notepad_node_metadata} m ON m.nid=s.node_id WHERE s.nid = %d AND n.uid = %d ORDER BY m.priority, n.created DESC", $nid, $user->uid);
you didn't implement the Drupal table-prefix at "FROM node". As workaround I hardcoded it there, because I actually don't know how to "get" the prefix.
Gtx,
Felix Lieb aka YAFA

#1
Hi Felix, yep, oversight on my part. With never using table prefixes it's something I overlooked.
I'll look into it this weekend and try and implement it properly, can't imagine it's a complex task.
Cheers,
Jon
#2
Lol, it's just missing the curly brackets, that's all that's needed.
#3
Fixed in 5.x-1.1.
#4
K, thx, great module ;o)
I have another idea, but I don't want to open a feature request, because it is a humble one.
I have a very small community-installation running, it previously was a phpBBplus-Board. We are recording all movies we watch in Cinema and we are using the user-points-module (because phpBB counted the posts and gave ranks to the users). I actually don't want to set user-points to zero for the created mdb_persons, because one should be granted the point, if he contributes content for it. So, a solution could be to select a different user for creation of the mdb_persons (not per person, just for all) within the mdb_movie-form. I could assign a dummy-user and when a user wants to contribute content for the person a configurable admin-switch (access control) allows to change the author of the person.
Hm, sounds more weired than it is. I just would like to be able to set another author for the automatically generated mdb_persons. If that functions sounds usable to you, keep it in mind.
Greetings,
Felix
#5
Hey Felix, not entirely sure i get you but I'm sure I can help. Drop me a mail through the contact form on my profile and we can chat directly over mail.
Cheers,
Jon
#6