Volunteer for support with ec_auction port to ecommerce 4
| Project: | e-Commerce |
| Version: | 6.x-4.0-rc5 |
| Component: | auction |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Hi folks,
I am a relative noob to the Drupal world and have been figuring my way by trial and error the last few weeks. I am trying to set up an auction website using ecommerce 4 on D6 and realized that I shall have to upgrade the contributed module for D5 to do that.
Last night, I used all the screencasts I could find for the coder, deadwood and schema modules to create an upgrade and did a rather lame hack (its actually shameful to even call it a hack). I simply altered the D5 dependency on product module to 'product API' without rewriting any hook implementations. As expected, my complete installation fell down like a pack of cards
Now, I don't know my way around e-commerce quite so well. I am having a had time figuring out exactly what has changed since D5 and altering the hook implementations. Can some kind soul volunteer to throw some light in the right direction? I am a fast learner and a few quick hints shall be more than enough. I shall contribute the module patch back to the community once I am done. Thanks a lot! Ciao

#1
The best place to get this information is in #drupal-ecommerce on IRC.
I think the productapi links that are being used are pretty much the same, and using coder to do the upgrade I have found that will get you pretty much the 95% of the way.
If you need any help post an issue with a specific problem or grab me in IRC.
#2
thanks Gordon... I was just leaving for a rafting trip this weekend.. Will get in touch with you once I am back on monday... will try to nail this within the next week..
I believe I was nearly there with all the changes I made with coder but given that Drupal just crashed twice without warning, i didn't get much of a chance to find out what really happened! Will definitely reach out to you again on Monday. thanks again!
#3
As promised, I am back again... Couldn't find any contributors in IRC so posting here..
There is a Parse error in line 316 of auction.module
return db_result(db_query('SELECT COUNT(t.txnid) FROM {ec_transaction_product} tp, {ec_transaction} t WHERE t.payment_status = %d AND t.txnid = tp.txnid AND t.uid = %d AND nid IN ('%s')', payment_get_status_id('completed'), $user->uid, implode(',', $nids)));
Honestly, I am having a bit of trouble analyzing what logic was used to return this given I am relatively handicapped in PHP...
Will try and figure out a way out myself during the night as well... Will post here if I get something additional...
Update: I figured that part of the code was non-critical. It was just checking if the user has made the payment or not. I just commented out the section and the corresponding function call in lines 552-556
Now the problem I face is that there is no content type named auction. I tried two approaches and both failed
1. I added a new content type (administer->content management->content type) named auction but am clueless as to how it will import all the properties defined in the auction module
2. I created a new product type in (administer->e-commerce configuration->products) named auction again but still the issue is the same! How do I link this with the definition in the module
I think I am quite close but missing something fairly obvious here... Please help!
#4
Finally, I figured the problem but not the solution. There is an error in the way I ported the hook_menu implementation resulting in 3 errors:
1. Any new auction created shows Bid Closed. I tried to change the default value directly in the MySQL table ec_product_auction (expires) but not successful)
2. Whenever I click on place bid, it gives a Page not found error
3. The auction type in ecommerce->configuration->product is not automatically created. I did that myself and gave it a name "auction item" and type "auction"
Can someone point me as to what is wrong here? I have attached the version of the updated module that I am using here.. It passes the test from coder.
D5 hook_menu implementation was:
function auction_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/ecsettings/auction',
'title' => 'Auction',
'description' => 'Set the default time-out for auction products.',
'callback' => 'drupal_get_form',
'callback arguments' => array('auction_ec_settings'),
'access' => user_access('administer store'),
'type' => MENU_NORMAL_ITEM,
);
}
else {
if (arg(0) == 'auction' && is_numeric(arg(1))) {
$items[] = array(
'path' => 'auction',
'title' => t('bid'),
'callback' => 'auction_page',
'access' => user_access('access content'),
'type' => MENU_CALLBACK
);
}
$items[] = array(
'path' => 'auction/checkout',
'title' => t('checkout'),
'callback' => 'auction_checkout_page',
'access' => user_access('place bids'),
'type' => MENU_CALLBACK
);
}
return $items;
}
I changed it to this in D6 but it isn't working properly... I have a feeling this is where I've gone wrong majorly. I have deliberately ignored the auction/checkout part for now.
function auction_menu() {
$items = array();
$items['admin/ecsettings/auction'] = array(
'title' => 'Auction',
'description' => 'Set the default time-out for auction products.',
'page callback' => 'drupal_get_form',
'page arguments' => array('auction_ec_settings'),
'access arguments' => array('administer store'),
'type' => MENU_NORMAL_ITEM,
'weight' => 1,
);
$items['auction/%fid'] = array(
'title' => t('bid'),
'page callback' => 'auction_page',
'page arguments' => array(1),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
#5
In the hook_menu() you need to use % instead of %fid. If you are using %fid the menu system us looking fid_load() to load the object.
#6
Thanks Gordon... That did the trick... I am stuck with just one issue now.. Any new item that comes on display automatically shows bidding closed. Maybe there is something wrong with the object instantiation...
Will try to solve that and post an update soon...
#7
Hi Gordon, I believe the rest of the issues are solved with exception of this one...
I am getting a warning that says "warning: Attempt to assign property of non-object in .\ecommerce\contrib\auction\auction.module on line 589"
Line 589 is shown below...
if (empty($node->expires)) {$node->expires = time() + (variable_get('auction_days', 1) * 24 * 60 * 60);
}
Any idea where I could have gone wrong?
#8
Basically it is that $node has not been assigned. Let me know which subroutine it is in and I could give you a more definative answer.
Also it sounds like you have some good code, so if you do not already have one you should apply for cvs access http://drupal.org/node/59 so that you can create a auction project and then commit your changes to cvs.
#9
Hello Gordon,
I have applied for a CVS account from your suggestion. Somehow I am still stuck with the earlier problem. Please see the attached version of the module
The warning is in line 589 of the attached auction.module file. Thanks a million for all the help!
Ravdeep
#10
Requested CVS account approved.
#11
This is great that you have been approved. What I recommend you do is that you rename it to ec_auction so that the name says that it is a part of the e-Commerce suite, and not other systems.
So you should be able to create a commit what you have done to the contrib repository and create a project.
I will take a look what you have done in a bit, and give you any pointers to fix it.
Gordon.
#12
Hello, I wanted to thank you for your work so far as I have a need to set up an auction for a charity. In the same vein, I was naturally curious what the status of this module is. I browsed the CVS- though perhaps the wrong branch, and didn't see anything pertaining to ec_auction. So- how are things going? I'd love to help you out, but know nothing about Drupal or e-Commerce, so I'm stuck in the position of being the nagger :)
This is also probably not the place to ask, but while you're here- I installed e-commerce 6.x-4.0-rc5 and only enabled store at first and let it enable the other things it required- then enabled the rest- but I don't have Product as a type when I go to Create Content. Have I set up e-commerce incorrectly somehow?
#13
I am not sure if anyone has done anything on this at all. But if you want to do some work in upgrading auction to and release a version for 6.x-4.x-dev.
See http://drupal.org/node/126493 for the final 5.x-4.x-dev release and you will fine the auction module. From this would be able to upgraded and used without too much hassle.
Please let us know how it all works out.
Gordon.
#14
Hi Gordon,
I created the ec_auction module today and added a the files to the CVS Link. There are multiple issues/functionalities I plan to add. Hopefully, should finish that in the coming few weeks
Issues:
1. The hook_menu is not properly configured. The callback (auction/%node->nid/bid) is not working properly
Gordon, can u check from ur experience on what maybe wrong here!
Functionality:
1. Add granularity to the auction end time (Day->Hour->Second)
2. Add a javascript countdown timer for time left
3. Add Ajax to refresh the bid page (number of bids and current winner) are refreshed continuously
4. Display message to the person who created the auction saying "not authorized to bid". Currently, it just removes the place bid button.
5. Enable bidding directly from the teaser view
Ravdeep
#15
I have taken a "quick" look at it, and I think that you need to rebuild your menu to get it going.
You could also change that menu so that it us auction/%node/bid so that argument 1 is a $node object instead of the nide id.
Give that ago, if it doesn't work let me know and I will take a closer look.
Hint: enable to the devel module which has the "rebuild menu" link on the development block.
#16
Thanks Gordon, Tried that out so now the submit form doesn't throw an error. The issue now is that the auction shows as 'ended' and doesn't allow bids. The form on the page node/nid shows the time left but the timer isn't running down. It stays at 24 hrs constantly.
I haven't tried this on Drupal 5 but can I safely assume that it was a production module in D5? If thats the case, maybe some of the function calls need fixing. Will look further into it later today...
#17
eC 4.x was never really released for Drupal 5, so it was not and there may be issues.
Also can you please update the http://groups.drupal.org/node/17377 modules for adoption list so people know it is gone.
Gordon.
#18
Has there been any more info released for this module?