pluginsGLPI / barcode

GNU Affero General Public License v3.0
36 stars 34 forks source link

Bug between item name displayed and qrcode #100

Closed cyrakuse closed 2 years ago

cyrakuse commented 2 years ago

When i use the "Don't use the XX first codes" field, i don't have the same thing in the item name displayed et the item name in the QRCODE.

If i put the "Don't use the XX first codes" value at "1", the datas in the QRCODE are correct but the item name diplayed in the bottom of the QRCode is the name of the previous QRCode on the page

I use GLPI v9.5.7 with barcode v2.6.2

cyrakuse commented 2 years ago

I've found the problem.

In qrcode.class.php, you have to replace in line 367 :

if ($ma->POST['eliminate'] > 0) { for ($nb=0; $nb < $ma->POST['eliminate']; $nb++) { $codes[] = ''; } }

By :

if ($ma->POST['eliminate'] > 0) { for ($nb=0; $nb < $ma->POST['eliminate']; $nb++) { $codes[] = ''; $displayDataCollection[] = ''; } }

cedric-anne commented 2 years ago

Hi,

Could you make a pull request with this change ?

cyrakuse commented 2 years ago

Sorry but don't know how to do that. Here is the modified file. qrcode.class.zip .