VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Studio 42 on February 12, 2016, 21:41:52 PM

Title: Admin manufacturer filtered BUG in edit product
Post by: Studio 42 on February 12, 2016, 21:41:52 PM
HI all,
A customer reported me a BUG today,
When he search for a manufacturer and do not reset the form and edited a product, the list of manufacturer in the product form is filtered by it's last search (so he had only one manufacturer and not full list) !
I tested this and the bug is real ! :)

It's with VM 3, but i think this is in all VM release, it's so hard to have this case, that i think none discovered this before!

So i think the session var should not be used when you are in the product edit form and perhaps other views ?
Title: Re: Admin manufacturer filtered BUG in edit product
Post by: Ghost on February 12, 2016, 22:29:53 PM
This is not a bug. All search variables in VM are now saved in session like in every Joomla component. This is very important for UX. Helps with product editing workflow, saves a lot of time.
Title: Re: Admin manufacturer filtered BUG in edit product
Post by: Studio 42 on February 12, 2016, 23:33:42 PM
I think, you don't understand.
When you search in the manufacturer view, the values are used in model for product view in admin.
This is a BUG!
If this was not a bug, then we use it same way for category too on edit a product and for customfields, ....
Title: Re: Admin manufacturer filtered BUG in edit product
Post by: Milbo on February 14, 2016, 11:17:27 AM
Please test vm3.0.13.2
Title: Re: Admin manufacturer filtered BUG in edit product
Post by: Studio 42 on February 14, 2016, 14:44:09 PM
The edit product use   shopfunction::renderManufacturerList
and in this function
     static public function renderManufacturerList ($manufacturerId = 0, $multiple = FALSE, $name = 'virtuemart_manufacturer_id') {

                $manufacturerModel = VmModel::getModel ('manufacturer');

                $manufacturers = $manufacturerModel->getManufacturers (FALSE, TRUE);

If it work now ($view was added in latest release) or not,  i think using $manufacturerModel->getManufacturerDropdown is more safe and faster

And here another issue(checked in trunk, code have not change)
QuoteWarning: array_merge(): Argument #1 is not an array in XXX\administrator\components\com_virtuemart\models\shoppergroup.php on line 167
This is not always an array in line 167 and  return php warning errors.