This topic is locked
[SOLVED]

Error using QR Code

10/2/2024 1:19:18 PM
PHPRunner General questions
A
alfonso authorDevClub member

I have the QRCode plugin installed in phprunner 10.91, inside the folder C:\Users\Usuario\OneDrive\Documents\PHPRunnerPlugins\view and inside C:\Program Files\PHPRunner10.91\viewPlugins. Then I have a field in my table called qr of type varchar 255. In that field, in view I have this:
$this->settings["qr_height"] = 128; // qr height/px
$this->settings["qr_width"] = 128; // qr width/px

But neither when adding records nor editing I can then see the QR for each record in the list. I don't know what I'm doing wrong.

Admin 10/2/2024

QRCode is a View plugin and not supposed to work on pages like Add and Edit.

A
alfonso authorDevClub member 10/2/2024

I mean I can't get the QR code to appear in the listing. I don't know if any additional configuration is needed
img alt
.

fhumanes 10/3/2024

Hello,

Plugin that operates on view pages work on List pages.

https://fhumanes.com/plugines/prueba_plugin2_list.php

Greetings,
fernando

A
alfonso authorDevClub member 10/5/2024

OK. From what I see, it's a conceptual error. I thought that it was enough to create the field so that the QR had the URL to access the record view. But I see that the field has to be added in the option to add and edit the record. So, I see that it works. But what I would like is for that field to be automatically filled with the URL for the record view and not have to do it manually. I suppose I can add some function in the events. Currently I have more than 5000 records and doing it one by one would not be an option.

A
alfonso authorDevClub member 10/5/2024

In the end I did it the following way.

I updated from MySQL with this function in a query: UPDATE inventory
SET qr = CONCAT('https://gestion.numantinos.com/inventario_view.php?page=view1&editid1='>https://gestion.numantinos.com/inventario_view.php?page=view1&editid1=', id_inventario);

The problem now is that I want that when records are automatically added in the QR field, the URL is also added. I am putting this but I cannot get it in the events in Before record added:
$url = 'https://gestion.numantinos.com/inventario_view.php?page=view1&editid1='>https://gestion.numantinos.com/inventario_view.php?page=view1&editid1=' . $values['id_inventario'];
$values['qr']=$url;

The problem is that the ID value will not be assigned yet

fhumanes 10/7/2024

Hello,

But you would not have problems if you make an update of the database record, in the "after" event.

Not so?

Greetings,
fernando

P.S.
In the field you just have to include a URL, not an HTML, which seems to be what you are generating