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...
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.
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?
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.