Announcement

Collapse
No announcement yet.

Error after project import / cannot open new project

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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| }
    Last edited by betty; 09-01-2015, 12:18 PM.

  • #2
    $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.

    Comment


    • #3
      Scriptcase v8.1.005 restore bugs

      Originally posted by rr View Post
      $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.
      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."

      Comment


      • #4
        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.

        Comment


        • #5
          Reverted to v8.01.0004 / tabs are working

          Originally posted by rr View Post
          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 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

          Comment


          • #6
            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?

            Comment


            • #7
              Originally posted by rr View Post
              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.

              Comment


              • #8
                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

                Comment


                • #9
                  Originally posted by jsbinca View Post
                  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

                  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.

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      Yep, that's what I did.

                      jsb

                      Comment


                      • #12
                        Originally posted by jsbinca View Post
                        Yep, that's what I did.

                        jsb
                        Thank you so much for your help!

                        Comment

                        Working...
                        X