Record not saved wh...
 
Notifications
Clear all

Record not saved when create new app in Combu 3.2.2

6 Posts
4 Users
2 Reactions
1,075 Views
(@squall)
Posts: 4
Active Member
Topic starter
 

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 4 years ago 2 times by squall
 
Posted : 02/12/2020 7:57 pm
(@skaredcreations)
Posts: 805
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

 
Posted : 03/12/2020 2:21 pm
(@squall)
Posts: 4
Active Member
Topic starter
 

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 4 years ago by squall
 
Posted : 05/12/2020 6:46 am
(@squall)
Posts: 4
Active Member
Topic starter
 

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')",
.....
}
....


}
 
Posted : 05/12/2020 8:27 am
Poy and millar5001 reacted
(@millar5001)
Posts: 1
New Member
 

@squall

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

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

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

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