VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Twix on January 26, 2012, 10:37:16 AM

Title: [BUG] Missing </div> in category VM 2.0.1b
Post by: Twix on January 26, 2012, 10:37:16 AM
File: components/com_virtuemart/views/category/tmpl/default.php
Version: 2.0.1b
Line: 286

What goese wrong?

Missing </div> breaking layout of page.

When goes it wrong?
If you have less products than the maximum products for a row.
if ($iBrowseCol == $BrowseProducts_per_row) { ?>

How to fix?
Also check if the current product is the last product. Then add </div>. I've fixed it this way (line 282):

   <?php
   
   // Do we need to close the current row now?
   if ($iBrowseCol == $BrowseProducts_per_row || $iBrowseProduct == $BrowseTotalProducts) {?>
   <div class="clear"></div>
   </div> <!-- end of row -->
      <?php
      $iBrowseCol = 1;
   } else {
      $iBrowseCol ++;
   }
   
   $iBrowseProduct ++;
} // end of foreach ( $this->products as $product )

I let it to the VM team to calculate $BrowseTotalProducts. I've added this at line 187, but it could be better I think:

// Count products
$BrowseTotalProducts = 0;
foreach ( $this->products as $product ) {
   $BrowseTotalProducts ++;
}

FIX ATTACHED

[attachment cleanup by admin]
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: Twix on January 29, 2012, 12:38:29 PM
It's also going wrong in components\com_virtuemart\views\productdetails\tmpl\default.php
If you add one review, there is a missing </div>, breaking the layout.

The </div> from line 645 needs to be placed after } at line 650. Original:

         </div>
         <?php
         } else {
            echo '<strong>'.JText::_('COM_VIRTUEMART_DEAR').$this->user->name.',</strong><br />' ;
            echo JText::_('COM_VIRTUEMART_REVIEW_ALREADYDONE');
         }
      }
   }

Becomes:

         <?php
         } else {
            echo '<strong>'.JText::_('COM_VIRTUEMART_DEAR').$this->user->name.',</strong><br />' ;
            echo JText::_('COM_VIRTUEMART_REVIEW_ALREADYDONE');
         }?>
      </div><?php
      }
   }
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: Milbo on January 29, 2012, 12:42:29 PM
hmmm. I wonder from where do you got the B version?
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: Twix on January 29, 2012, 12:54:00 PM
I've downloaded com_virtuemart.2.0.1_extract_first.zip from http://dev.virtuemart.net/projects/virtuemart/files. The extracted name is com_virtuemart.2.0.1b.zip.

In the same file, components\com_virtuemart\views\productdetails\tmpl\default.php, there goes something else wrong. I have wrote 1 review and published it. If you logout in front-end there should be a review. However it shows only the H4 heading "Beoordelingen". I see where it goes wrong:

      <div class="list-reviews">
         <?php
         $i=0;
         $review_editable=true;
         $reviews_published=0;
         if ($this->rating_reviews) {
            foreach($this->rating_reviews as $review ) {
               if ($i % 2 == 0) {
                  $color = 'normal';
               } else {
                  $color = 'highlight';
               }

               /* Check if user already commented */
                // if ($review->virtuemart_userid == $this->user->id ) {
               if ($review->created_by == $this->user->id && !$review->review_editable) {
                   $review_editable = false;
                }
               ?>

               <?php // Loop through all reviews
               if (!empty($this->rating_reviews) && $review->published) {
                   $reviews_published++;
                   ?>

$review->published is apparently not 1 (line 540). If you delete it, it works.

-edit-
If I refresh my back-end the published is again not published. So the problem is somewhere in the backend I guess.

-edit2-
If I edit dB table published=1, it works fine.

-edit3-
Only problems with the publish shortcut icon.
I think the bug is at line 81 at administrator\components\com_virtuemart\views\ratings\tmpl\default.php
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: Twix on February 03, 2012, 14:44:54 PM
This bug is still present in VM 2.0.1c
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: cas on February 04, 2012, 21:23:57 PM
I upgraded to VM2.0.1.d with Joomla 2.5.1, and now the menu does not work properly when user not logged in.  When I click on the parent menu item, it just briefly opens to show the children menu items and then closes.   So I cannot select any children menu items.  The children menu items should remain open until I click on a different parent menu item.  But when logged in, it works properly.
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: cas on February 16, 2012, 07:31:07 AM
Upgraded to VM2.0.1.K and it still does not work properly.
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: cas on July 17, 2012, 02:10:40 AM
Upgraded to VM2.0.6 and it still does not work properly when user is not logged in. 

VM Team, is there a fix coming? 
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: Milbo on July 17, 2012, 10:35:38 AM
why do you not use 2.0.8c? or e?

Quote from: cas on February 04, 2012, 21:23:57 PM
I upgraded to VM2.0.1.d with Joomla 2.5.1, and now the menu does not work properly when user not logged in.  When I click on the parent menu item, it just briefly opens to show the children menu items and then closes.   So I cannot select any children menu items.  The children menu items should remain open until I click on a different parent menu item.  But when logged in, it works properly.

and what has this todo with the rest of Twix post? Which is looong time solved. And the error above, I even dont know about which menu you are talking and why it is virtuemart and not maybe just joomla.
Title: Re: [BUG] Missing </div> in category VM 2.0.1b
Post by: cas on July 17, 2012, 19:56:03 PM
Hi Milbo,

Since 2.0.8 has been changing so often (a,b,c,d,e) I'm waiting for it to get stable.  Is it stable yet?

It has everything to do with Twix post since it's not solved.  It's the VM Category module, which is a menu of VM categories & subcategories. 
Go to my test site at: https://www.designerfurniturecenter.com    On the left side you will see the 'VM - Category' module... click on item 'Living Room'... you will see that it does not open up to show the 3 subcategories, but you will see the 3 subcategories in the center of the page so you know they exist.  Now if you login using a test account you can create, you will see the VM - Category module work properly.  When you click on the 'Living Room' category, it will open up and you will see the 3 subcategories below it.

Thanks,
Chuck