5 Replies Latest reply on Sep 27, 2010 8:28 AM by TSGal

    Importing Custom Functions from an open database can fail

    jjackson+fm@pobox.com

      Summary

      Importing Custom Functions from an open database can fail

      Product

      FileMaker Pro

      Version

      11.0v2

      Operating system version

      OS X 10.6.4

      Description of the issue

      If you have a set of custom functions that refer to each other (ie, custom function A calls B, which calls C, etc.)

      and

      you import them into a new database, from an existing database that is currently open, the import will succeed and report no errors, but actually can be silently failing. If you look at the functions, you will see either , or the entire function's contents commented out.

      If this can't be fixed, disable imports from open files!

      Steps to reproduce the problem

      See the description above.

      Expected result

      I would expect if an import happens, and any changes are made to the incoming function, either by commenting out the code or inserting then this should be both logged and reported as an error.

      If this can't be fixed, disable imports from open files!

      Actual result

      Nothing gets logged, and no errors are reported.

      Exact text of any error message(s) that appear

      None.

      Workaround

      Close the file you are importing from solves the problem.

        • 1. Re: Importing Custom Functions from an open database can fail
          TSGal

          John Jackson:

          Thank you for your post.

          I am unable to replicate the problem with FileMaker Pro 11v2 on Mac OS X 10.6.4, 10.5.8, and Windows XP.  Here is what I did:

          I created three custom functions:

          a3 = Abs(a)

          a2 = 1 - Mod (a; 2)

          a1 = a3 ( a2 (a)) * 2

          I left that file open, created a new database file, went into Custom Functions and imported the three custom functions.  No problem.

          Obviously, this is a simplistic case, so it may be better if I take a look at a clone of your file so I can try it here.  Check your Inbox at the top of this page for instructions where to send the file.

          TSGal
          FileMaker, Inc.

          • 2. Re: Importing Custom Functions from an open database can fail
            jjackson+fm@pobox.com

            Hi,

            Thanks for the reply. I have done some more work on this, and have narrowed the problem further.

            When I went back and tried to recreate the problem, at first I couldn't reproduce the problem either. But I took your example, and worked with it.

            The mistake I had made was that it turns out it doesn't matter if the file is open or closed.

            What matters is that you don't import all referenced functions.

            If you accidentally leave off a referenced function, then the import happens, no errors are reported, but the imported functions get modified: they get disabled with comments. 

            To reproduce: take your example, but just import functions a1 and a2. Function a2 will be fine, but function a1 will be commented out, as it references a3, which doesn't exist.

            The import routine knows something is wrong -- it commented out the function -- but it doesn't report an error.

            There is a mention that references are not imported in the dialog box that reports the import results. However, if the code knows that it needs to comment out a function, it should report that as an error and log it. It should log which function was modified, and why. ("Function a1 disabled as it references missing function a3.") It can be very hard to track these errors down. You have to look through each function, find which ones have been commented out, check each referenced function to see which one is triggering the string of defaults...

            (As it was, it was hard enough to figure out what exactly the bug was...)

            If you can, you may want to change the title of this to "Importing Custom Functions from another database can silently fail".

            Thanks for looking at this.

            • 3. Re: Importing Custom Functions from an open database can fail
              jjackson+fm@pobox.com

              One other thought:

              I was not able to reproduce the circumstances under which "<Function Missing>" was inserted into a script.

              Whoever looks at your source code should check and see when that gets used and make sure that it triggers a log entry and an increment to the error count.

              thanks.

              • 4. Re: Importing Custom Functions from an open database can fail
                TSGal

                John Jackson:

                I received your email.  Thank you.

                I am able to reproduce your findings.  An unreferenced function is commented out, and there is no warning this occurred during the import.

                I have forwarded your posts along with my findings to our Development and Software Quality Assurance (Testing) departments for review and confirmation.  I will keep you posted as information becomes available.

                TSGal
                FileMaker, Inc.

                • 5. Re: Importing Custom Functions from an open database can fail
                  TSGal

                  John Jackson:

                  Our Testing department has forwarded this issue to our Development department for further review.

                  TSGal
                  FileMaker, Inc.