Wappler 7 Beta 12 Writing Erroneous Code into Library Actions (Found Out Why!)

Wappler Version : Beta 7 v12
Operating System : Windows 11
Server Model: PHP
Database Type: MySQL

Expected behavior

What do you think should happen?

Wappler should write correct code when saving a Library Action.

Actual behavior

What actually happens?

This evening it managed to write erroneous code like this into 3 of my library actions:

How to reproduce

I've no idea how to reproduce this currently, but I wanted to report it happening so you are aware of it. I will try to find what is happening over the next few days!

I have a library action file it seems to be happening to consistently... I can DM it to whoever this bug report is assigned to.

Update 1 - it seems that once it starts saving a library action this way, it does it every time you do a save…

Update 2 - this morning I have restarted my laptop and its no longer happening... so something got reset in Wappler since last night...

Update 3 - it has all just happened again tonight... I will shortly DM a copy of the corrupt files to @patrick.

There are certain Library Actions which if I open from the Workflows panel, I can work on and save and everything is okay.

However if I open by double clicking on an include statement in another library action, work on the design and then save, this file corruption takes place.

Update 4
The bug is happening again this evening and I've not opened a library action by clicking on an include all day.

Right now I can fix the code, but then when I go back and make a simple change to the function and press save, the library action is written with the erroneous code again...

... so maybe it more more pervasive than I had thought last night.

Update 5
I've gone back to Beta 7 v10 and it is still happening, so I think it must be related to something in the code itself.

It just happened to the file record_payment_success.php, which is one of the files I sent to Patrick...

@George ... have you been able to find what is causing this?

I'm stuck back in the dark ages of Beta 7 v10 until it is fixed, and I'd love to continue to be part of the Beta 7 journey! :tada:

The issue is related to double clicking the library action step to edit.
If you open it normally from the server connect panel it will be fine.
We will fix this in the next betas.

1 Like

Fixed in Wappler 7 beta 14

@george, @teodor,

Thanks for your work on this folks... but unfortunately it isn't fixed.

I installed Beta 7 v14 last night.

Since then I have not opened any library actions by double clicking on include statements.

I have not really opened library actions using Quick Open much either.

I just found the follow in the header of my library action record_payment_success.php.

You can see that Wappler has also put the sort and dir $_GET parameters into the file... is there some part of the content of this file which is causing Wappler Beta 7 v13+ to think it is an API action rather than a library action?

<?php
require('../../../../../../../../../dmxConnectLib/dmxConnect.php');


$app = new \lib\App();

$app->define(<<<'JSON'
{
  "meta": {
    "$_GET": [
      {
        "type": "text",
        "name": "sort"
      },
      {
        "type": "text",
        "name": "dir"
      }
    ]
  },

You have to reopen the library actions in the editor and save them again

@george, Thanks for your quick reply!

I've just edited the post above. I think there is something in Wappler that sometimes treats this library action as an api action.

The file was okay this morning.

I edited it this evening in Beta 7 v14 and now this erroneous code has been added again...

Hi again @george...

It just happened again with B7v14...

Interestingly, it was another situation where Wappler has chosen to add an erroneous input to the library action... this time Wappler added one of those record POST variables.

There is something in Wappler which is confusing a library action with a server action when database actions are added, and once the erroneous input has been added, the save process is then putting the wrong PHP/JSON header into the file.

No amount of opening and saving was able to fix this one... I needed to edit the JSON code.

record

IMPORTANT UPDATE...

@George ...

So I've just played around with this file after I have fixed the JSON code and removed the POST input.

If I open the file from the left hand Workflows panel, edit and save, all is okay.

if I open the file from the Quick Open, edit and save, then it is saved with the incorrect code.

Each time the edit was just to make a condition disabled and then enabled again, so no actual change of function or structure.

Aha yes, we have to fix also opening library actions from quick open. The rest should be all fine

1 Like

But what about these incorrect GET and POST inputs being added? :thinking:

fix the quick Open for Library actions

Fixed in Wappler 7 beta 16