Notifications
Clear all

Record not saved when create new app in Combu 3.2.2

(@squall)
Active Member Registered

Hi,

I am using the latest Combu 3.2.2 and started from scratch. I have the database created using dbeaver and run the table creation SQL script successfully. Everything was fine. When I tried to create a new app via Registered App->Create App, after filling the form and pressed the save button the message "Data has been correctly saved" was displayed, however nothing was saved into the appid table. To ensure it is not a DB connection issues, I tried Server Settings->Create and successfully created a few keypairs and the data were saved to serversettings table correctly. I am thinking maybe you have some suggestion before I spend more time finding the issue

FYI the local environment I am using - Nginx 1.18, PHP 8.0 NTS and MySQL 8.0.22 Community

Thanks and Regards

 

This topic was modified 1 year ago 2 times by squall
ReplyQuote
Topic starter Posted : 02/12/2020 7:57 pm
(@skaredcreations)
Prominent Member Admin

It's pretty strange that you're receiving a successful message after executing the query if it's not saving, you can edit the function Save inside /vendor/skaredcreations/combu-lib/combu/AppId.php and add the following code after the line that contains "$Database->Query($query)":

echo "<pre>$query</pre>"; exit();

This way you should see the SQL query being executed (the AppId and Secret fields should contain random GUID-like strings), then try to execute it in your MySql tool software (phpMyAdmin, MySql Workbench, DBeaver, etc) to see if it's creating a record or giving an error.

FRANCESCO CROCETTI @ SKARED CREATIONS

ReplyQuote
Posted : 03/12/2020 2:21 pm
(@squall)
Active Member Registered

Hi,

Sorry for my late reply, the game is just a personal side project. Weekend now :),  I have more time and here's the SQL

  • SELECT Id FROM `AppId` WHERE Name = 'test' AND Id <> new' --> the check Exists SQL
  • UPDATE `AppId` SET Active = 0, Name = 'test', Description = 'Test TEST' WHERE Id = 0  --> the Save SQL

The SQL is obviously wrong, it should be INSERT or REPLACE. The AppId table is empty.

 

 

 

 

This post was modified 1 year ago by squall
ReplyQuote
Topic starter Posted : 05/12/2020 6:46 am
(@squall)
Active Member Registered

Hi,

I have solved the issue with a simple modification to the AppId.php which I share below for your input. FYI the AppId.php is located in <COMBU Installation Folder>\vendor\skaredcreations\combu\combu folder.

Seeing the different folder you mentioned in your reply, I wonder would it be the combu asset in Unity App Store has some unknown issues.

Below is my simple modification that has make it work

public function Save() 
{
global $Database;

if ($this->Id == 'new') --> I added this
{
$this->Id = 0;
}

if ($this->Id > 0) {
$query = sprintf("UPDATE %s SET Active = %d, Name = '%s', Description = '%s' WHERE Id = %d",
....
} else {
$this->Active = 1;
$this->AppId = Utils::NewGUID();
$this->Secret = Utils::NewGUID();
$this->DateCreated = Utils::GetCurrentDateTimeFormat();
$query = sprintf("INSERT INTO %s (Active, DateCreated, AppId, Secret, Name, Description) VALUES (%d, %s, '%s', '%s', '%s', '%s')",
.....
}
....


}
ReplyQuote
Topic starter Posted : 05/12/2020 8:27 am
Poy and millar5001 liked
(@millar5001)
New Member Registered

@squall

Thank you. Only just got this asset and had the same issue.

ReplyQuote
Posted : 26/12/2020 2:19 pm
 Poy
(@guplem)
New Member Registered

@squall This fixed the issue for me as well! Thank you very much!

ReplyQuote
Posted : 23/11/2021 1:07 pm
Share: