Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
In the Skinr Advanced Help file skinr/help/skinr.help.ini there is indentation for sections in the file. The indenting is done with double spaces and when the current version of Advanced Help is enabled, it throws a syntax error:
warning: syntax error, unexpected END_OF_LINE, expecting '=' in ./sites/default/modules/skinr/help/skinr.help.ini on line 10 in./sites/default/modules/advanced_help/advanced_help.module on line 667.
The ini file looks like this:
[overview]
title = "Overview"
weight = 0
[syntax]
title = "Syntax"
weight = 1
[css-js]
title = "CSS, Stylesheets & JavaScript"
parent = syntax
weight = 1
[features]
title = "Features"
parent = syntax
weight = 2
[templates]
title = "Templates"
parent = syntax
weight = 5
[examples]
title = "Examples"
parent = syntax
weight = 6
Removing or replacing the double spaces with tabs causes the error to go away. Is this a bug with Advanced Help or should the .ini files not have indented sections?
There is a related issue in the Skinr queue:
Comment | File | Size | Author |
---|---|---|---|
#4 | error-on-admin-advanced_help.png | 107.04 KB | Jacine |
#4 | line-endings-settings.png | 83.81 KB | Jacine |
#4 | skinr.help_.ini_.zip | 869 bytes | Jacine |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedAdvanced Help just calls parse_ini_file() to parse the file. That may be a bug (or at least inconsistency) of parse_ini_file that it wants tab indentation. =(
Comment #3
fgmI just tested the code above and it causes no error in the current advanced_help, or actually in a straight use of parse_ini.
What I suspect is that the .ini file is really missing a final LF character (some editors tend to do that).
Can you reproduce the problem without changing tabs/spaces, but adding a LF at the end of the file ? There are all sorts of issues boiling down to how fgets() in the standard C library behaves with files not ending with a LF.
Comment #4
JacineOh, I didn't realize this issue existed. Sorry, I must have missed it.
I'm pretty sure the line endings are LF. I've attached the file, which I created in TextMate (along with my settings). I also attached a screenshot of the error. It only happens on admin/advanced_help (screenshot is from D7 btw, but it was the same in D6).
Anyway, this is really not a big deal, I just stopped indenting, problem solved ;)
Comment #5
fgmHi, the issue is typically not with the line endings themselves, but with the lack of a new line after the last variable. Normally, just adding one empty line at the end of the file should fix the issue, even with indenting.
Comment #6
fgmFixed as seen on Skinr issue queue.