This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

ecommerce extention

Hello,

For a project in school we, that's me and my partner, have to develop an e-commerce site.
Drupal is perfect for that.

What we would like is categorising products.
Not after the product is made, but while creating the product.
As I saw in the forum several times, this is not possible with the ecommerce module.
We would also like to add specifications to the products, for example height and width, when creating the products.

Help! Database abstraction confusion

Allo

Can anyone help a Drupal newbie understand how the database abstraction layer works, and why I'm having a problem?

My problem: I'm using the location module with the Gmap module, so folks can locate themselves on a google map. This works fine for nodes, but not for users, which gives the error:

user warning: Duplicate entry '0' for key 1 query: INSERT INTO location (eid, type, latitude, longitude, source) VALUES (5, 'user', 52.95112016368184, -1.141204833984375, 1) in c:\program files\easyphp1-8\www\ukcohouse\drupal-5.1\includes\database.mysql.inc on line 172.

I've found the code in gmap_location.module that's doing this (I think!) but there are a number of things going on that I don't get. The code I think is trying to insert the table into {location}:

db_query("INSERT INTO {location} (eid, type, latitude, longitude, source) VALUES (%d, '%s', '%f', '%f', '%d')",
        $object->eid, $type, $object->gmap_location_latitude,$object->gmap_location_longitude, 1);

Before I can start trying to fix this, I need to understand it, and I'm a bit flummoxed!

I'm finding the database abstraction API confusing: I hope someone can help out there. How does Drupal use the modifiers? Are they having the concurrent variables passed to them? Are they simply in the order that follows, e.g. %d = $object->eid, '$s' = $type, etc?

If so, I think the table needs a unique ID, which I believe is the 'lid' field. This doesn't seem to be added in the query above. Is there a setting through PHPmyAdmin that would make this column auto-increment? Or should I use something like LAST_INSERT_ID( )?

Any help would be enormously appreciated: the rest of the site's working wonderfully. (This is my first Drupal site, having used Joomla before: Drupal, it must be said, is soooo much better...)

Dan

Where the event_calendar go ?

I used event and event_views module on my 4.7 site, on views admin page, there are event_select, event_js, event_date and event_calendar etc. default pages.

But I found the event_calendar seems missing at HEAD version of event.module while I update my site to 5.0. I am wording that anybody else got this problem or just me?

Due to I need the event_calendar views page to create different calendars of content types, please tell me why this happened and how to fix it.

Database error: duplicate entry... what might be causing this?

Greetings,

I've been developing some add-ons for the location & Gmap modules: these two together allow the user to -

1. Select their own location in a google map and save this as part of their profile
2. Select location for a node (which I'm using with organic groups, so a group admin can select the location of their group.)

I've built a module to display this data how I want: but the problem is with the location selection. When any user other than the main admin tries to set their location via their profile, I get this error:

user warning: Duplicate entry '0' for key 1 query: INSERT INTO location (eid, type, latitude, longitude, source) VALUES (5, 'user', 52.95112016368184, -1.141204833984375, 1) in c:\program files\easyphp1-8\www\ukcohouse\drupal-5.1\includes\database.mysql.inc on line 172.

This doesn't happen with any nodes: that works fine.

The location data is stored in a table called, um, 'location' - that the location module creates upon installation.

It seems odd: there's no problem in installing node data, but for profiles, there's this 'duplicate entry '0'... Can someone help me interpret this? The actual error is thrown from the database interface (database.mysql.inc) so I'm not sure how to trace it back. The query above looks fine, though I'm no expert.

This forum:

http://drupal.org/node/81822

... hints there may be something wrong with the way the table was set up, and suggests deleting a rebuilding it with changes - but I'm loath to do that, since I may still have the same problem.

Any advice would be greatly appreciated.

Dan

the hook_submit wouldn't be triggered

There suppose are some problem on this page module with the form submt. The form can be properly displayed, however, the validate, and submit hook didn't work. Would you help me have a look.

Invited users can register without admin approval

I have the invite module installed and it seems that when users are invited, they can follow the link in the invitation email and, after registering, can login right away and gain access to content without the admins ever knowing about it. I double checked my user settings and they are set to "Visitors can create accounts but administrator approval is required." Also, 'Require e-mail verification when a visitor creates an account' is checked, but I don't even get an email when someone who is invited registers.

The readme.txt that came with the module says:

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions