Error after project import / cannot open new project

I used FILE > EXPORT PROJECT to export a known good project.
Then FILE > IMPORT PROJECT to import that export into a new project.

When I try to login to the new project, I get this error message (There have been NO changes to the code):
Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead) in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\sec\Login\sec_login_apl.php on line 1310

This is line 1310 (and surrounding code) in that application:

1304| //--------------------------------------------------------------------------------------
1305| function NM_gera_log_insert($orig=“Scriptcase”, $evento="", $texto="")
1306| {
1307| $dt = “’” . date(‘Y-m-d H:i:s’) . “’”;
1308| $usr = isset("") ? “” : “”;
1309| if (in_array(strtolower($this->Ini->nm_con_[‘tpbanco’]), $this->Ini->nm_bases_sqlite))
1310| {
1311| $comando = "INSERT INTO (id, inserted_date, username, application, creator, ip_user, action, description) VALUES (NULL, $dt, " . $this->Ini->nm_db_->qstr($usr) . “, ‘sec_login’, ‘$orig’, '” . $SERVER[‘REMOTE_ADDR’] . "’, ‘$evento’, " . $this->Ini->nm_db->qstr($texto) . “)”;
1312| }
1313| else
1314| {
1315| $comando = "INSERT INTO (inserted_date, username, application, creator, ip_user, action, description) VALUES ($dt, " . $this->Ini->nm_db_->qstr($usr) . “, ‘sec_login’, ‘$orig’, '” . $SERVER[‘REMOTE_ADDR’] . "’, ‘$evento’, " . $this->Ini->nm_db->qstr($texto) . “)”;
1316| }

$usr = isset("") ? “” : “”; is the line where the error is. This is incorrect php.
So if you find that code back in sources you should be able to find it back.

This is a scriptcase routine so I suspect that it is a bug. Do please mention your version number of scriptcase so that someone alese can check/fix it.

Scriptcase v8.1.005 restore bugs

[QUOTE=rr;39952]$usr = isset("") ? “” : “”; is the line where the error is. This is incorrect php.
So if you find that code back in sources you should be able to find it back.

This is a scriptcase routine so I suspect that it is a bug. Do please mention your version number of scriptcase so that someone alese can check/fix it.[/QUOTE]

I also tried this morning to do a backup / restore using PROJECT > EXPORT APPLICATION and then PROJECT > IMPORT APPLICATION. The export seems to work fine. When I try to import I get this error:
“The file was not generated with Scriptcase version 8.”

That means that your application file is damaged. I cant help you here.
I would export the same application 4 times and compare all exports. Logic says they should all be the same. If they are not then you have a hardware problem.
Just to be sure it is not a hardware issue.

Reverted to v8.01.0004 / tabs are working

[QUOTE=rr;39967]That means that your application file is damaged. I cant help you here.
I would export the same application 4 times and compare all exports. Logic says they should all be the same. If they are not then you have a hardware problem.
Just to be sure it is not a hardware issue.[/QUOTE]

Reverted back to v8.01.0004; Menu Tab Context Menu is working again.

Still cannot export / import project. The process itself seems to work … but when I try to log into the newly imported project, I still get this error:
Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead) in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\bbw_group_admin3\login\sec_Login_apl.php on line 1247

So then I updated to v8.01.0004 again; Menu Tab Context Menu is still working.

Still cannot export / import project. The process itself seems to work … but when I try to log into the newly imported project, I still get this error:
Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead) in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\bbw_group_admin3\login\sec_Login_apl.php on line 1247

I even tried closing the browser before logging into the newly imported application; doesn’t make a difference.

Then I create a new project using the Security Module example (this is untouched by me - created by Scriptcase). When I try to login to it, I get this error:
Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead) in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\security5\app_menu\app_menu.php on line 2059

I guess you need to remake that application. Sometimes due to bugs we dont see scriptcase does something wrong… Have you tried to recreate the same application again?

I have created the same application again. In fact, I created a new project based on the security module - and made no modifications to it whatsoever. If I export the project and and import back to the same project - no problem.

The problem is that I was trying to import the project with a new name - creating a new project. I thought that I used to be able to do that … to create a project, then use that project as the starting point for a new project (rather than do everything from scratch). Apparently, that option is now broken.

So - I have a project named “security”. I export that project. Then I import that project and rename it to “administration”. That’s where it breaks.

I think I had the same issue a while back and it turned out it was the missing logging scheme.
You might check on this one.

jsb

[QUOTE=jsbinca;40015]I think I had the same issue a while back and it turned out it was the missing logging scheme.
You might check on this one.

jsb[/QUOTE]

Well … rebuilding the log table and applying that to the schema got me a little further … this is the new error:
Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead) in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase\app\bbw_admin_test2\sec_logged\sec_logged_apl.php on line 1163

So we might be onto something… not sure what to do now but it is, at least, encouraging. I guess I just need to get ‘the process’ down.

That’s it. I’ll test a few more times with apps that I had issues with previously … but so far … this is the process:

Export source project.
Import into target project.
Build a new log.
Apply the log schema.
Regen source code.

Yep, that’s what I did.

jsb

[QUOTE=jsbinca;40027]Yep, that’s what I did.

jsb[/QUOTE]

Thank you so much for your help!