Tags stop working in Gray Dragon after activating basket module

wwz

Joined: 2011-11-05
Posts: 12
Posted: Sun, 2011-11-20 23:21

G3 3.0.2
Gray Dragon version 3.1.3

Tags work fine on default wind theme and tags work also on Gray Dragon before Basket is activated.

clicking tag got a blank page after I installed and activated Basket module. Here are the screenshots before and after. Please help.

AttachmentSize
before.png775.21 KB
after.png138.69 KB
 
cndxt

Joined: 2012-04-05
Posts: 5
Posted: Mon, 2012-04-09 11:39

EDIT:

OK it needs a few steps more to solve this...

This is caused by basked-side-bar.html.php

Problems in this one:

- If Foto is not for sale, etc, a blank Basket will be shown in the sidebar
- When opening the All Tags Module link in the Main Menu, you will have an empty gallery page
- When opening any other module which displays data, empty gallery page will be shown
- If you have deleted a Photo from the Basket, it will shown you a blank Basket

I solved this like this and it works fine except for the last point above. There were too much changes to keep it in the (nasty) shortopentags PHP-Style so i rewrote the basket-side-bar.html.php

Quote:

<?php
if ($theme->page_type != 'basket'){
if (basket::can_view_orders())
{
echo '<a class="g-button ui-icon-left ui-state-default ui-corner-all ui-state-hover" href="' . url::site("basket/view_Orders") . ' title=\"View Orders\"><span class=\"ui-icon ui-icon-clipboard\"></span>View Orders</a>';
}

$item = $theme->item();

if (method_exists($theme->item(), 'is_photo'))
{

if ($theme->item()->is_photo() && product::isForSale($theme->item()->id))
{
echo '<p><a class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all ui-state-hover" href="' . url::site("basket/add_to_basket_ajax/$item->id") . '" title="Add to Basket"><span class="ui-icon ui-icon-plusthick"></span>Add to Basket</a></p>';

}
if (!isset($basket->contents) && !$theme->item()->is_photo())
{
echo 'MESSAGE TO DISPLAY WHEN BASKET IS EMPTY AND FOTO IS NOT FOR SALE';
}

}

if (isset($basket) && isset($basket->contents) && ($basket->size() > 0)) {

echo '<div id="sidebar-basket"><table id="gBasketList"><tr><th>Item</th><th>Cost</th><th></th></tr>';

$total=0;
foreach ($basket->contents as $key => $prod_details){

echo '<tr id="" class="' . text::alternate("gOddRow", "gEvenRow") . '"><td id="item-' . $prod_details->item . '" class="core-info">';

$item = $prod_details->getItem();

echo '<img src="' . $item->thumb_url() . '" title="' . $item->title . '" alt="' . $item->title . '" style="max-width:90px;"/><br/>' . html::clean($prod_details->quantity) . ' x ' .
html::clean($prod_details->product_description()) . '</td><td>';

$total += $prod_details->cost;
echo basket::formatMoneyForWeb($prod_details->cost);
echo '</td><td class="g-actions"><a href="' . url::site("basket/remove_item/$key") . '" class="g-button ui-state-default ui-corner-all ui-icon-left"><span class="ui-icon ui-icon-trash"></span></a></td></tr>';

}

echo '<tr class="' . text::alternate("gOddRow", "gEvenRow") . '">';
echo '<td>Total</td><td id="total">' . $basket->ispp()?basket::formatMoneyForWeb($total + $postage):basket::formatMoneyForWeb($total) . '</td><td></td>';
echo '</tr></table></div><br/>';
echo '<p><a class="g-button right ui-icon-left ui-state-default ui-corner-all ui-state-hover" href="' . url::site("basket/view_basket") . '" title="Checkout"><span class="ui-icon ui-icon-cart"></span>Checkout</a></p>';

}
else
{
echo 'SOMETHING TO DISPLAY WHEN INSIDE A MODULE-GENERATED GALLERY PAGE AND EMPTY BASKET IS PRESENT';
}
}

?>

Explanation:

For example, inside the All-Tags Module Page, $theme->item()->is_photo() is NOT present, along with other relevant methods and propertys, thus trying to call will throw an 500 Server Error.

Empty Basket Sidebar Block will be displayed because there is no defined Output Message in the php-file. So it will just output nothing

If you delete a foto from the basket, the class methods responsible for the correct recognition of the basket content will not correctly return this value OR it is not deleted correctly from the session variables. I have no fix for this atm, but will post it if i found a solution.

NOTE: This is tested only with the current GD Theme, Basket, All-Tags and Tag-Albums.

Greetings

Nick

 
martinog

Joined: 2011-11-10
Posts: 16
Posted: Wed, 2012-08-01 21:05

Thank you so much for this Nick. I've been trying to find a solution for months and just stumbled across this now.

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Wed, 2012-11-21 14:11

Does this edit still need to be done, or does the new basket files rWatcher fixed take this into account?

===========================
Version: 3.0.4 (Ricochet)
Operating system: Linux 2.6.18-194.11.4.el5
Apache/2.2.21
PHP: 5.3.8
MySQL: 5.0.95
Clean Canvas theme
Graphics Toolkit = ImageMagick
Albums: 235
Photos: 75002

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Wed, 2012-12-12 20:32

It is in the new version.

===========================
Version: 3.0.4 (Ricochet)
Operating system: Linux 2.6.18-194.11.4.el5
Apache/2.2.21
PHP: 5.3.8
MySQL: 5.0.95
Clean Canvas theme
Graphics Toolkit = ImageMagick
Albums: 235
Photos: 75002