TypeError: parent.writeFastMenu is not a function

Hi,

Would you know why I have this javascript error : “TypeError: parent.writeFastMenu is not a function” ?

For information, I convert my app from SC7 to SC8, and I applied the SC8.1 updates.

I checked in the index.php scripts, they all have this bloc, but I don’t understand what it referred to :
[INDENT][SIZE=10px]<?php
[…]
if(…){
[…]
?>
<script type=“text/javascript”>
link_atual = new Array (<?php echo $rastro ?>);
[/SIZE][SIZE=10px][SIZE=11px]parent.writeFastMenu(link_atual);[/SIZE][/SIZE]
[SIZE=10px] </script>
<?php
}
else
{
?>
<script type=“text/javascript”>
[/SIZE][SIZE=10px][SIZE=11px]parent.clearFastMenu();[/SIZE][/SIZE]
[SIZE=10px] </script>
<?php
[…][/SIZE][/INDENT]

Thank you for your help,
Best regards,
C.L.

Hello,

Are you saying that after conversion, the menu application started to show JavaScript errors?
This error is only displayed in the error console through the browser or is preventing any of their own menu application functionality?
Please, send me only the application menu in version 7 so I can do the conversion locally.

E-mail: j.lennon@scriptcase.net

Hello,

First of all, thank you for your answer, JLS.

It is an hypothesis, I only assume that the conversion is the cause. But, I noted that after this conversion, I had this JS error.

This error is displayed in the error console through the browser. Unfortunately, I removed old version of the menu, and I can’t send it to you.

Would you know what ‘writeFastMenu’ and clearFastMenu refers to ?

Thank you again,
C.L.

We will check the problem, meanwhile can you tell us if this error stopped any custom javascript code OR any menu feature from working properly?

This error seems not to affect the rest of the JS code, but when I try to call a “SC index.php” with ajax, this “JS script block” is returned and encapsulated in the response string … and it fails from Client side (client is waiting onlys for “JSON string”, but it, actually, retrieves “JSON string + '<script … > … clearFastMenu…</script>

I precise that :

  • [B]all the 'index.php' generated by SC [/B]([I]except the sec_menu[/I]) include the block I described in my first post (if ... [SIZE=10px][SIZE=11px][B]writeFastMenu [/B][/SIZE][/SIZE]... else ... [SIZE=10px][SIZE=11px][B]clearFastMenu[/B][/SIZE][/SIZE])
  • I created a new test Menu application and I checked the code : [B]no writeFastMenu or clearFastMenu appears[/B]

Some help please ?

Hello,

Certainly this problem is occurring by ‘junk’ generated some option that was on and off.
We try to simulate the problem locally have not identified it. I need you to send me just the menu application (need not be the entire project) and report the types of applications that are linked to items.

So, I need two things:

  • Exported Menu Application
  • What types of applications linked to menu items.

Thus, we can make a better analysis of the problem.

Hello John L.,

I am willing to send you my menu APP, but before, could you, please, explain me why all the APPs ‘index.php’ include this PHP block (see "if … [SIZE=10px][SIZE=11px]writeFastMenu [/SIZE][/SIZE]… else … [SIZE=10px][SIZE=11px]clearFastMenu[/SIZE][/SIZE]"), whereas the “SC MENU APPs” do not, themselves, include these JS functions ?

Moreover, if all the ‘APPs index.php’ include this PHP block (and so, these JS functions), at least one Parent application should have the prototypes of these functions, which is not the case when I do a search in all the application content files (even in the lib sub folders).

Thank you for your answer
Regards,
CL

The menu have this function.
However the function is written dynamically based on the flag:
[SIZE=12px]Show navigation breadcrumb ([/SIZE][SIZE=12px]Show the navigation breadcrumb each time an opened application calls another application[/SIZE][SIZE=12px]).[/SIZE]

Furthermore it seems is a problem with “normal” menu only. Our tree menu handle this differently and apparently it is working fine.
The things is that apps linked to the menu all make calls to this parent function, and sometimes it isn’t available as you concluded on your own.

This will be fixed within the next releases, for now, if you aren’t using this option ([SIZE=12px]navigation breadcrumb[/SIZE]) just define the functions to do nothing and you’ll be ok.

Hello,

Thank you for your answer.

Indeed, as I explained you in a PM, I have no right to use “navigation breadcrumb”, consequently, SC automatically set it to “No”.

As you suggest, I added the two empty function prototypes in my Menu APP.

This problem is bypassed for me, but I would like to notify you an other thing : I wrote a JS function in my “menu APP” calling an other “Empty SC APP” thanks to AJAX.

This “Empty SC APP” is not linked (I am almost sure) to my menu, and yet, when It is called by this JS/AJAX function, it returns a message containing, also, the string “<script type=“text/javascript”> link_atual = new Array (’<a href="./?script_case_init=1&script_case_session=mk63as8glq ru0v5na0bchu9t45" target="#NMIframe#">app_name1</a>’,’<a href="./?script_case_init=1&script_case_session=mk63as8glq ru0v5na0bchu9t45" target="#NMIframe#">app_name2</a>’); parent.writeFastMenu(link_atual);</script>”.

For this second problematic, in order to avoid malformed message, I had to implement some code excluding this JS string encapsulated in the returned AJAX message.

I don’t know if you consider this as a bug, what do you think about this ?

Thank you,
Regards,
C.L.

Since this flag / functionality was added after the new tab menu was released I believe this is a workaround on our own so that if an app is called via Ajax it would still do the bead crumb navigation.
But I am not sure since I haven’t check all the bread crumbs logic neither developed this particularly flag.

We will consider a bug if it disturbs the logic of the apps, OR, if this prevents the executions of some js code for example.
So if any of this cases turns out to be truth feel free to mention it and we will check it out.

Ok, thank you for this explanation !
As it disturbs one of my JS code, we could consider it as a bug.
What do I do now, do I have to close this post, or something else ?

Contact the support, write on forums or send a Feedback on our website.

You have to detail the problem, how it happens and what should happen if there wasn’t any problem.
So our test team might try to reproduce it and validate if it is a bug or not.
If you include a step-by-step on how to reproduce it, it would speed the process by a lot.

But remember, it has to disturb the functionality of the Scriptcase app OR prevent the execution of JavaScript codes.
(This doesn’t include error by bad coding of the users, in any case our test team will probably ask for your app / database in case they can’t reproduce it).

For example:
a) The app stop working as intended.
b) An exception was raised and crashed the JavaScript.
etc…

Hello,

I restart this item because I bought SC8 and I always have this problem. Would you know what happens or if it has been taken into account in new releases ?

Here is the concerned JS message : “TypeError: parent.writeFastMenu is not a function”

Thank you for your help,
Regards
CL

Hello xof.
This problem was fixed a little later after this topic.

Try re-generating the application. If it persists, contact our support.
We can’t help you here in the forums unless you provide further information, like John asked you before.