PDA

View Full Version : Warning: windowcontrol: Database referencing controls must have a name attribute.



Varsuuk
May 16th, 2018, 04:32
"Database oath: 'charsheet.id-0001' "

So, this pops up in console but I didn't notice it when it happened and it appears on my desktop as well which is about 2 days of updating behind my laptop.

How do I troubleshoot this one? I looked for all uses of literal getDatabase to check if they had "name" in control. I saw that the charsheet.0001 indeed does have a name (<name type="string">Varsuuk</name>) at the level right below the id-0001.

Tips?

Trenloe
May 16th, 2018, 04:40
"Database oath: 'charsheet.id-0001' "

So, this pops up in console but I didn't notice it when it happened and it appears on my desktop as well which is about 2 days of updating behind my laptop.

How do I troubleshoot this one? I looked for all uses of literal getDatabase to check if they had "name" in control. I saw that the charsheet.0001 indeed does have a name (<name type="string">Varsuuk</name>) at the level right below the id-0001.

Tips?
The key here is "Database referencing controls must have a name attribute" - you have either a stringfield or numberfield control (or windowlist) in your FG XML (not db.xml) that does not have a name attribute in the XML specification. It is not a database field called "name", it is a XML specification for a database accessing control that needs name="whateveryouwanttocallit" as part of the control specification. e.g. <stringfield name="label1">...

Varsuuk
May 17th, 2018, 02:03
Still looking.

What's with the "charsheet.id-00001" ? There is no string text even containing "charsheet" anywhere in my code (other than an openWindow("charsheet_classes") line in code.

If it is in the XML (don't doubt you) why are they referencing my charsheet!!! Stinkers, giving such misdirection (I am guessing that some control in my xml missing the name= is REFERENCING a piece of data in the charsheet.id-00001 etc. But still, if not for you I'd be trying to find an error in the db.xml.

Wish I had been able to git my code all along instead of just 2 days back when added a bunch at once... bah. I could have made a local git vs waiting on my gitserver to be reinstalled but wait I did.

At least I kept backing up the directory regularly, I can try going back to an earlier one that doesn't have the issue and diff if I am too self-code-blind to see it.

Trenloe
May 17th, 2018, 02:28
Provide a screenshot of the console and further detail of what you're doing, what ruleset you're modifying etc..

That "Database oath..." entry just looks like some debug that someone’s put in the code. It might be a complete red herring.

Trenloe
May 17th, 2018, 02:34
If you have a stringfield, numberfield or windowlist control - these all store their data in the database - whose base database node is usually set through the window instance. If the control doesn’t have a name, then FG doesn’t know which field in the FG database to get/store data. This is the error you're getting.

If the error occurs when you open a specific tab on the character sheet, then go through the window class for that tab and check that all controls that relate to a DB field have a name= attribute in the FG XML.

Varsuuk
May 17th, 2018, 03:00
Provide a screenshot of the console and further detail of what you're doing, what ruleset you're modifying etc..

That "Database oath..." entry just looks like some debug that someone’s put in the code. It might be a complete red herring.

Ironically, took a screenshot and forgot to upload it. Can’t for a while because now getting son to bed.

Also, I understand why you think it’s debug, it the typo is MINE ;) it does say Database PATH not oath ;)

And as I said I searched for “charsheet” in my directory so it’s def coming from code outside. I’m sure you are right, I looked again before putting son to bed but haven’t yet seen it.

The ruleset is barely begun only one partially working tab (basic gui, now started on data access) - I probably messed up a string field in last few days of work since msg was not always there.

Will update later when back at code. Thanks.

Trenloe
May 17th, 2018, 03:30
Also, I understand why you think it’s debug, it the typo is MINE ;) it does say Database PATH not oath ;)
That was part of it, but not much really. It's very rare for standard FG rulesets (not community rulesets) to output debug to the console. Open the console and leave it up for a session of a standard ruleset with no extensions - you won't see much, if any, debug.

Varsuuk
May 17th, 2018, 06:35
Just as you said Trenloe, thank you for telling me what to look for.

It was:



<linkifnotemptyfield name="race_link">
<description field="race" />
</linkifnotemptyfield>


Which was a template with attached script. Eventually led to a "linkfield" (from CoreRPG)

Anyway, that's fixed now. Was quick after my game tonight thanks to you.

23499

I finally attached the screenshot not that it was needed any longer ;)