Author Topic: Admin manufacturer filtered BUG in edit product  (Read 629 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4367
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Admin manufacturer filtered BUG in edit product
« 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 ?

Ghost

  • Jr. Member
  • **
  • Posts: 422
Re: Admin manufacturer filtered BUG in edit product
« Reply #1 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.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4367
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Admin manufacturer filtered BUG in edit product
« Reply #2 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, ....

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Admin manufacturer filtered BUG in edit product
« Reply #3 on: February 14, 2016, 11:17:27 am »
Please test vm3.0.13.2
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4367
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Admin manufacturer filtered BUG in edit product
« Reply #4 on: February 14, 2016, 14:44:09 pm »
The edit product use   shopfunction::renderManufacturerList
and in this function
Code: [Select]
     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)
Quote
Warning: 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.