Author Topic: Bug in VirtueMartModelState getStateByCode (Rev 5074)  (Read 1071 times)

Stephen Roberts

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 142
    • SundaySchool.com
Bug in VirtueMartModelState getStateByCode (Rev 5074)
« on: December 14, 2011, 21:52:01 pm »
I believe there's a bug in the state model's getStateByCode() function. The $code variable is being treated as an int in the query:

Code: [Select]
$query = 'SELECT * FROM `#__virtuemart_states` WHERE `' . $stateCodeFieldname . '` = ' (int)$code;
If I understand the function properly, the code should be treated as a 2 or 3 character string.
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9843
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Bug in VirtueMartModelState getStateByCode (Rev 5074)
« Reply #1 on: December 14, 2011, 22:36:46 pm »
Interesting,. on the other side, this code is never called. So I just deleted it. I think it was done while we add the security stuff in the summer. Thx
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Stephen Roberts

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 142
    • SundaySchool.com
Re: Bug in VirtueMartModelState getStateByCode (Rev 5074)
« Reply #2 on: December 14, 2011, 22:48:51 pm »
Gotcha. It was almost identical to getStateIDByName() in shopfunctions.
Sell downloadable (virtual) products in VirtueMart 2 and deliver downloads via local server, Amazon S3, and more! http://www.digitollsoftware.com