Expired ads

rusdvl - July 27, 2009 - 22:15
Project:Classified Ads
Version:6.x-2.0-alpha5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Once an ad is expired and i click the reset checkbox and save. the expiration date is reset but the ad isnt published... anyway to make it published?

#1

milesgillham - July 28, 2009 - 02:35

I've noticed that too. It makes sense to re-publish the ad when the expiration date is reset. I'll give this some attention in next day or so to resolve.

Cheers,

Miles

#2

rusdvl - July 29, 2009 - 20:46

Hey, just wondering if you managed to find a fix for this? Cheers.

#3

kirkhings - July 30, 2009 - 22:38

Yeah, I have a similar issue. It worked before fine, then we had to disable to troubleshoot another module and we didn't want this getting in the way. Now we re-enabled and everything seems fine, however when you publish the ad the expiration date is set to the minute/second you hit publish. Going back in to edit and 'reset' expiration date resets expiration date to new minute/second you hit publish, but still is of course considered expired.

Errors are:

    * warning: reset() [function.reset]: Passed variable is not an array or object in /var/www/drupal/sites/all/modules/ed_classified/ed_classified_utils.inc on line 137.
    * warning: Variable passed to each() is not an array or object in /var/www/drupal/sites/all/modules/ed_classified/ed_classified_utils.inc on line 138.

I upgraded calendar and date modules in that interim, maybe a conflict there?

Thanks for the great module when it is working!

#4

milesgillham - July 31, 2009 - 05:48

@kirkhings: The form handler is not picking up any taxonomy terms to work out longest duration. The default response of the function is '0' which is added to present time(). That's causing your problem - immediate expiration. The root cause is more concerning as there is a compulsory For Sale / Wanted taxonomy that should at least be coming through. Have you deleted the default Classified Ads taxonomy? Either that, or ed_classified has become confused as to what taxonomy it's using as a default. I wouldn't have expected Calendar or Date modules to clobber the Classified Ads taxonomy.

However, to specifically address the symptoms I have modified -dev branch for that function to return the module's default expiry time duration (presently 30 days) which is a good failsafe (well, better than zero) and will show if that's what is happening. I've also tweaked the function to be a little more robust - if it receives no taxonomy it will be more graceful. Do you need a patch or are you happy to pull down a -dev copy? This will get rolled up in the beta release next week either way.

Cheers,

Miles

#5

milesgillham - July 31, 2009 - 06:09

@rusdvl: I have done this now in the -dev branch. If you extend the expiry date of an ad then the module checks to see if the ad is unpublished and publishes it automatically.

Cheers,

Miles

#6

milesgillham - July 31, 2009 - 06:10
Status:active» fixed

#7

kirkhings - July 31, 2009 - 14:29

I don't think we deleted the default classifieds taxonomy. Just checked, no the terms I setup are still there. IAC I happily updated with your -dev and it works great now.

Thanks for the prompt response you are a rock star, keep up with this module cuz you can make a great niche module here.

#8

kirkhings - July 31, 2009 - 14:47

Whoops little problem in the other direction now. Just posted a test add and I got:

expires on Mon, 12/04/2028 - 7:59am (19 years 18 weeks)

Whoops at least the ad shows but 19 years is a little longer than I intended 8^)

So I thought maybe I should investigate this further. I realized the ad categories were not available in ads anymore either so...

I checked my taxonomy pages and checked into Taxonomy > List > Edit vocabulary (for the classified ad category). Lo and behold under content types (which you check the box to associate the particular taxonomy with a particular content type) my classified ad taxonomy was not checked anymore.

Checked the box to re-associate the taxonomy to content type, went back and created a new ad in a correct taxonomy, and the expiration date is 4 weeks 2 days which equals awesome.

Thanks again for the fix, and I'll give back by posting your css I tweaked to make the categories more substantial, maybe consider if you want to adopt it as default or an alternative style:

ul.classified-category-list { list-style: none; padding:1em; width: 95%;}
ul.classified-ad-list li { background-image: none; }
ul.classified-category-list li { margin-bottom: 2px; padding: .5em; background-image:none;}
ul.classified-category-list .even { background-color: #eee; margin: 0 0 20px 0; }
ul.classified-category-list .odd { background-color: #ccc; margin: 0 0 20px 0; }
div.classified-cat-name { font-size: 20px; font-weight: bold; padding:0; margin: 0 0 10px 0; line-height: 1em;  }
div.classified-description { margin:0; padding:0; display:inline; font-style:italic; }
.classified-description { margin-bottom: 0px; line-height: 1.2em; margin-left: 2em; }
ul.classified-category-list li div.classified-description p { display:inline; }
ul.classified-category-list li div.title { margin-left: 1em; font-size: 16px; font-weight: bold;  }
ul.classified-category-list li div.created { margin: 0 0 10px 50px; font-style: italic; font-size:smaller; }
ul.classified-ad-list h3 { font-size:small; }
ul.classified-category-list li .status { font-size: smaller; margin:0; padding:0; padding-left: 6em; width: 91%; clear: both;}
.classified-date { font-weight: bold; font-size: smaller; }
span.classified-expiration-info, span.classified-expiration-expires-soon { font-weight: bold; text-align:right; display:block; margin-bottom: 1em; padding:.25em;}
.classified-expiration-expires-soon { background-color: yellow; }
.classified-expiration-expired { background-color: red; color: yellow; text-decoration: blink; }
.classified-expiration-info { background-color: #eee; }
.classified-body, .classified-teaser { margin-left: 20px; margin-top:1em; font-size: 1.2em; }
div.classified-ad-block .marker { font-size:smaller; }
div.classified-ad-block ul li { margin-bottom: .5em; }
div.classified-ad-block ul li a { display:inline; }
div.classified-ad-block ul li span { display:inline; }
.classified-block-ad-term, .classified-block-ad-count, .classified-block-ad-age { margin-left: 1em; display: block; font-size: smaller; font-style:italic; }
.classified-expired-flag { color:red; }
.classified-unexpired-flag { color: green; }
.node-classified { border: solid 1px silver; padding: 1em; }
.classified-bodylength-exceeded { background-color: red; color: yellow; }
.classified-bodylength-ok { color: green;}
#classified-bodylength-msg { font-weight: bold; }
#classified-credits { margin-right: 1em; font-size: 7pt; text-align:right; font-style: italic; }
.classified-category-link-add { text-align: center; font-size: 20px; }
.classified-profile-link-add { margin-left: 0em; }

#9

milesgillham - July 31, 2009 - 23:59
Status:fixed» needs review

Awesome! Okay, I'll have a look at the code - this isn't the first time I've heard of the taxonomy becoming disconnected - I'll add some check code to make sure they stay associated and some boundary checks to stop ads being around long enough for the next generation to enjoy. ;-) And I'll review your CSS, thx v much! I've been wanting to do some work to make this module more easily themable. Will flag this bug for more work.

Cheers,

Miles

 
 

Drupal is a registered trademark of Dries Buytaert.