VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Jose M. on July 07, 2017, 17:46:08 PM

Title: Bug in shopfunctionsF ?
Post by: Jose M. on July 07, 2017, 17:46:08 PM
Hi,
I'm sorry if I'm wrong, but line 520 of the file shopfunctionsf.php I think it should be

if(isset($view->doVendor) && $noVendorMail) {

instead of

if(isset($view->doVendor) && !$noVendorMail) {

That is, that $noVendorMail is TRUE


Thanks
Jose

Title: Re: Bug in shopfunctionsF ?
Post by: Milbo on July 07, 2017, 19:42:09 PM
Which version? because it seems it is now already as you suggest.
Title: Re: Bug in shopfunctionsF ?
Post by: Jose M. on July 07, 2017, 21:45:43 PM
Hi Milbo!

I have reviewed 3.2.3.9587, 3.2.2 and 3.21

Greetings!

Jose M.
Title: Re: Bug in shopfunctionsF ?
Post by: Milbo on July 12, 2017, 13:58:07 PM
Take a look here

http://dev.virtuemart.net/projects/virtuemart/repository/diff/branches/com_virtuemart.3.0.12.4/components/com_virtuemart/helpers/shopfunctionsf.php?utf8=%E2%9C%93&rev=9402&rev_to=9400

It was set correctly, from begin on.
Title: Re: Bug in shopfunctionsF ?
Post by: Jose M. on July 12, 2017, 18:18:18 PM
Hi Milbo,
Is this a feature to send an email to the seller?
Then it only does when $noVendorMail is FALSE and I think it should be when $noVendorMail is TRUE.

I had the problem that when I sent an email to buyers who had indicated "notify me", for each mail to a buyer, he received an email as a seller.
That is, if you send ten emails to ten buyers, the seller also receives ten emails.

Changing !$noVendorMail for $noVendorMail in line 520, it only sends mail to buyers.

Sorry, I'm a bit confused.
Thanks
Jose
Title: Re: Bug in shopfunctionsF ?
Post by: Milbo on July 13, 2017, 07:48:46 AM
I was also confused. I read your post exactly the opposite, lol. I read
the code is .... it should be....
But you wrote,.. the code should be that ... instead of this.

But you describe the correct behaviour. This function should send an email to the vendor if "doVendor" is set. For old legacy reasons, we have to use the isset. Of course it should be just one boolean, that would be easier. As you can see the code has a comment

//TODO this is quirk, why it is using here $noVendorMail, but everywhere else it is using $doVendor => this make logic trouble

The code was written by a lot people. But back to the problem.


if(isset($view->doVendor) && !$noVendorMail) {

The standard is $noVendorMail=false, this means, when a doVendor is set, then it sends the vendor email.
Title: Re: Bug in shopfunctionsF ?
Post by: Jose M. on July 13, 2017, 09:54:34 AM
Hello,
I am sorry, I do not speak English and I can not explain it well.

The question is that now, send mail when $noVendorMail is FALSE or not set.

Thanks
Regards

Jose
Title: Re: Bug in shopfunctionsF ?
Post by: Milbo on July 25, 2017, 08:20:46 AM

if(isset($view->doVendor) && !$noVendorMail) {


It should send the vendor email for

doVendor = true and $noVendorMail=false

Title: Re: Bug in shopfunctionsF ?
Post by: Jose M. on July 25, 2017, 22:43:24 PM
Thanks!

Jose