Potential bug on ajax refresh of offerDetail - FIXED IN V3.2

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Potential bug on ajax refresh of offerDetail - FIXED IN V3.2

Post by bamse » Sat Dec 29, 2012 11:15 pm

Not sure whether this is due to my own modifications or due to the fact that I was testing with two different "bidders" on a single computer (which is identical with the server). Anyway here it goes...

On the offer detail page of standard auctions (haven't tested on other types), I had one user bid and another watch. The watching user will see updated data after an AJAX refresh. However two strange things happen after AJAX refresh on the offerDetail page of the watching user:

1. The bid count is updated to values larger than 5 (if more than 5 bids are submitted), even though themes/../offerDetailsStandard.php shows only a number less or equal to 5.

2. The href under "View history" changes and clicking on it takes me to the confirm bid page which is very confusing. Is this intentional?

I understand that "1." could easily be fixed in Action/Offer.php->bidDetails.php, modifying the line

Code: Select all

$data['bidsCount']=count($bids);
but I am not sure "2." is as it should be. Would be happy if somebody with a clean install could confirm this.

RWAP
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by RWAP » Sun Dec 30, 2012 11:57 am

This is part of the code I have never looked at (it is on my to do list).

1) Enuuk displays all bids in the table, not just the last 5, so that must be down to your own modifications and handling of the AJAX call.

2) I guess the href on bid history is intended to reload the page - although I am not sure why. The relevant code is in global.js:

Code: Select all

function refreshDetailsUpdate(JSONData){
    active = JSONData.active;
    if(!JSONData.active){
        clearInterval(refreshDP);
    }
    DOMPrice = $('#currentPrice');
    var price = JSONData.currentPriceText;
    if(JSONData.currentPriceText != DOMPrice.text() ){
        DOMPrice.animate({backgroundColor: "#4ED"}, 1000)
                    .text(price)
                    .animate({backgroundColor: "white"}, 1000);
        var timeDelta = JSONData.endDateDelta;
        DOMTime =$('span.countdown');
        DOMTime.countdown('destroy')
                    .animate({backgroundColor: "#4ED"}, 1000)
                    .countdown({until:timeDelta, expiryUrl: window.location.href})
                    .animate({backgroundColor: "white"}, 1000);
        var bestBidder = JSONData.bestBidder;
        DOMBidder =$('#bestBidder');
            if(DOMBidder.length){
                DOMBidder.animate({backgroundColor: "#4ED"}, 1000)
                    .text(bestBidder)
                    .animate({backgroundColor: "white"}, 1000);
            }
        var bidsCount = JSONData.bidsCount;
        DOMBidder =$('#bidsCount');
            if(DOMBidder.length){
                DOMBidder.animate({backgroundColor: "#4ED"}, 1000)
                    .text(bidsCount)
                    .animate({backgroundColor: "white"}, 1000)
                    .next('A').attr('href', window.location.href)
                        .attr('onclick','');
            }

    }
}
The idea is that clicking on the history should reload the page - unfortunately, this will not work if the page was displayed as a result of you placing a bid as the window.location.href will be the bid confirmation page (rather than the offer details page).

The only reason I can think of for refreshing the whole page when you click on bid history, is because (a) the bid history table may not exist (if when you initially went to the page, there were no bids) and (b) the bid history is not being updated.

Can you report this to Enuuk to get them to release the fix for this as I am not sure what time I will have to fix this for the next few weeks.

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by bamse » Tue Jan 01, 2013 7:15 pm

I'd like to report this, but still haven't recovered my old account from before they changed their website. Sent them two emails (to sales@enuuk.com) but without reply so far. Seems like I will have to call them, or do you know an email address that works?

(Since I joined less than a year ago, I'd also like to take advantage of this offer: http://www.enuuk.com/old-customers

RWAP
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by RWAP » Wed Jan 02, 2013 8:57 am

I would email support @ enuuk.com

I never got a response from sales @ enuuk.com for some reason!

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by bamse » Wed Jan 02, 2013 2:11 pm

Thanks, I finally got a reply from sales@phpauction.net. Will e-mail support@phpauction.net shortly concerning this bug.

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by bamse » Thu Jan 03, 2013 8:49 am

No reply yet, but I'd like to investigate myself. Just need a pointer to find the relevant code.

Do you know which part of the code does the redirecting, e.g. when placing a bid you are returned to the offer detail page. Or when you logout you are redirected via the logout page to the home page?

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by bamse » Tue Jan 08, 2013 8:41 am

Just an update on my customer experience with enuuk, which I mentioned above...

I now am in contact with them again and as a customer who joined less than a year ago, they also send me the "fidelity pack", i.e. phpauction v3.1. Unfortunately only in the obfuscated version, even though I bought the non-obfuscated version v2.10 and got a non-obfuscated upgrade to v2.11 before...

RWAP
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by RWAP » Tue Jan 08, 2013 9:40 am

That is odd - they should send the non-obfuscated version if you previously had that!

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by bamse » Tue Jan 08, 2013 8:08 pm

I'd think so too. Now they are offering a deal, to get the non-obfuscated version in exchange for writing a testimonial at http://www.enuuk.com/testimonials

Let's see where this goes...

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: Potential bugs on ajax refresh of offerDetail page

Post by bamse » Tue Jan 15, 2013 10:50 pm

I got feedback regarding the bug. They propose the following hack (untested so far):

on the top of themes/.../offerDetailsHeader.php add:

Code: Select all

<? if($postBid){ ?>
    <script type="text/javascript">
        setTimeout( function(){window.location = "<?=$relativePath?>offer/details/<?=$id?>";}, 8000);
    </script>
<? }?>
and in
class/Action/Offer.php->wanted() before $this->details(), add:

Code: Select all

                    $this->context->addData(array("postBid"=>1));

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest