Errors: "Object expected" & "MCGlobals is null..."

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
Cecily
Sr. Propeller Head
Posts: 217
Joined: Wed Sep 10, 2008 6:01 am
Location: England

Errors: "Object expected" & "MCGlobals is null..."

Post by Cecily »

I've just upgraded to Flare v5 and have 3 projects, with HTML help as the target output.

Since the upgrade, one of them has 16 topics (out of 99) where, if you click on them in the TOC of the compiled help, you get these errors. Oddly, the line and character numbers quoted in the error are the same for all 16 topics.

First error "Object expected".

Whether you click Yes or No to it, you get the same second error, "MCGlobals is null or not an object":

Whether you click Yes or No, the page is then displayed correctly.

I can't find "MCGlobals" in any of the affected topics (even when opening in the text editor), and Googling generates hits relating to a certain fast food chain.

Any suggestions gratefully received.
You do not have the required permissions to view the files attached to this post.
"Books are a narcotic." (Franz Kafka)
I wonder what he'd say about help files?
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by KevinDAmery »

It does say the problem is in a script, so I would suspect one of the js files that Madcap includes when they build a help system (MCGlobals sounds like a Madcap variable name - they put "mc" in front of everything).

Now, why one of Madcap's scripts would be failing is beyond me, but I think that's where I would start looking.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
Cecily
Sr. Propeller Head
Posts: 217
Joined: Wed Sep 10, 2008 6:01 am
Location: England

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by Cecily »

KevinDAmery wrote:Now, why one of Madcap's scripts would be failing is beyond me
or why it's only some topics in one of the projects.

Anyway, thanks for the pointer. It sounds beyond my skill, so I've logged it with support (though as I only have Bronze level, it may be several days till I get a response).
"Books are a narcotic." (Franz Kafka)
I wonder what he'd say about help files?
Cecily
Sr. Propeller Head
Posts: 217
Joined: Wed Sep 10, 2008 6:01 am
Location: England

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by Cecily »

The mk:@MSITStore:C:\WINDOWS\Help\ bit gets plenty of Google hits, but many of them are very old (one suggests reinstalling IE6!), though several suggest re-registering the hhctrl.ocx file with Windows. But if that was necessary, surely all three projects would exhibit the problem? So, now that I've logged it as a bug, I'll wait for a response from MadCap, rather than dabbling recklessly and possibly making things worse.
"Books are a narcotic." (Franz Kafka)
I wonder what he'd say about help files?
Cecily
Sr. Propeller Head
Posts: 217
Joined: Wed Sep 10, 2008 6:01 am
Location: England

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by Cecily »

If anyone else gets this problem, apparently it arises when :
These topics were "re-used." These topics were part of a already compiled help file by Flare. The reason why you did not get the errors when compiling with Flare 3 is because Flare 3 was less strict with its XML format.
If you use files from an output file, its good to clean up the .js referenced files.
I don't know when or in what sense that happened (all the affected topics were created before I worked on the project), but all you have to do to fix it is open each such topic in the internal text editor and remove the offending lines. In my case, it was the following 3 lines (near the top):


<script src="SkinSupport/MadCapUtilities.js">/*<![CDATA[*/ /*]]>*/</script>
<script src="SkinSupport/MadCapEffects.js">/*<![CDATA[*/ /*]]>*/</script>
<script src="SkinSupport/MadCapEffectsMenu.js">/*<![CDATA[*/ /*]]>*/</script>
Last edited by Cecily on Tue Jul 28, 2009 2:26 am, edited 1 time in total.
"Books are a narcotic." (Franz Kafka)
I wonder what he'd say about help files?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by LTinker68 »

Those lines are added automatically when Flare builds the output. You shouldn't see them in your authoring files unless you copied an outputted .htm file into the project or at some point had your output building to your content folder (which is a big no no).
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Cecily
Sr. Propeller Head
Posts: 217
Joined: Wed Sep 10, 2008 6:01 am
Location: England

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by Cecily »

Having got this sorted earlier in the summer, for which thanks, the problem has just recurred in one of the projects that didn't have the problem then (I checked every topic page of all three related projects).

It didn't take very long to fix this time, but I'm worried about how it happened and whether it will happen again.

When it first occurred, I couldn't be certain that an outputted .htm file hadn't been copied into the project or that output hadn't been built into the content folder, but no one else has worked on these projects since I encountered the problem and I know those rules haven't been breached in that time.

How worried should I be?
"Books are a narcotic." (Franz Kafka)
I wonder what he'd say about help files?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by LTinker68 »

Cecily wrote:How worried should I be?
Hard to say. If it doesn't happen consistently and it's only happening on your computer and no one else's at work, then it's hard to track down if it's a problem in Flare itself, your environment, or something that you or someone else at your work is doing. Perhaps keep a journal, so to speak, of the last time you edited a project. When you next go to the project, check its last modified date in the journal and compare it to the dates of the files and folders in the project. If any of the files and folders have a newer date than what the journal says, then something (or someone) may be updating the files or writing without your knowledge and you might be able to backtrack the problems to them.

Also, are you using the global project feature? I haven't used it myself, but if you're using it and the problem is in the "master" project, then it would theoretically flow down to the "children" projects.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Cecily
Sr. Propeller Head
Posts: 217
Joined: Wed Sep 10, 2008 6:01 am
Location: England

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by Cecily »

Thanks (again) Lisa.

No one else is accessing the Flare files (most colleagues couldn't, and those that could, wouldn't). It is compiled on a build server, but the problem appeared locally (before being checked into source control and built on the server)

Yes, I am using global project linking, but whilst the project that originally exhibited the problem was the parent project, none of the affected topics then or now are imported/exported ones and when it recently appeared in a child project, the parent project was fine. However, in both cases, all the affected topics were older ones (i.e. created before I started working on it, and in earlier version of Flare, or maybe even RoboHelp).

I guess I'll just have to remember to check at the end of each release.
"Books are a narcotic." (Franz Kafka)
I wonder what he'd say about help files?
gmorgan
Propeller Head
Posts: 18
Joined: Thu Apr 20, 2006 7:57 am
Location: Brea, CA

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by gmorgan »

Hiya,
I have run into the same error as above but from a different angle. For reason's MadCap Support and I have worked out, I have to develop in Flare 5 and generate webhelp in Flare 3.1. I have moved between them just fine in the past but now, when I moved from Flare 5 down to 3.1, I get that error when I try to preview the topic. I have looked for the script shown above but it does not exist in the content topics for me.

Thoughts from anyone?
Thank you,
g
Cecily
Sr. Propeller Head
Posts: 217
Joined: Wed Sep 10, 2008 6:01 am
Location: England

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by Cecily »

gmorgan wrote:I have looked for the script shown above but it does not exist in the content topics for me.
I'm not sure what you mean by "the content topics".

In case you've misunderstood my comments, let me clarify:

For each of the topics that generates the error, I go to Flare's Content Organiser, right click on the topic and select
Open With > Internal Text Editor

The topic opens in the main panel and then I look for three lines starting
<script src="SkinSupport/MadCap....
and delete them.

If you don't have those lines, I suggest you refer back to support.
"Books are a narcotic." (Franz Kafka)
I wonder what he'd say about help files?
gmorgan
Propeller Head
Posts: 18
Joined: Thu Apr 20, 2006 7:57 am
Location: Brea, CA

Re: Errors: "Object expected" & "MCGlobals is null..."

Post by gmorgan »

Thanks for the clarification. I still do not know why I was getting the script error but after I generated web help in Flare 3.1, the script errors I was getting during Preview all went away.
Post Reply