schulle4u / yellow-extensions-schulle4u

My experimental extensions for Datenstrom Yellow.
GNU General Public License v2.0
15 stars 4 forks source link

CSV extension cannot parse csv file (but works "on page") #25

Closed dajare closed 3 years ago

dajare commented 3 years ago

Hi - this looks like a very useful extension. I have tried using it with current Yellow, but have an odd behaviour:

I have tried:

but nothing seems to help. Is there something else I can look into? Thanks for your help with this!

schulle4u commented 3 years ago

Thanks for your report. Can you please activate the debug mode or check your webserver's log file for additional errors? In any case the csv file needs to have delimiters, and the extension should recognize the most common ones (comma, semicolon, tabstops). However this shouldn't cause the extension to crash if its missing.

dajare commented 3 years ago

Thanks - and sorry, by "delimiters" I only meant quote-marks in the CSV - I just copy/pasted the country data example you give for the markdown block approach. That's my "test.csv" file.

Here's the error dump:

Fatal error: Uncaught Error: Call to undefined method YellowToolbox::normalisePath() in /home/account/public_html/yellowsite/system/extensions/csv.php:22 Stack trace:
#0 /home/account/public_html/yellowsite/system/extensions/core.php(580): YellowCsv->onParseContentShortcut(Object(YellowPage), 'csv', 'test.csv', 'block')
#1 /home/account/public_html/yellowsite/system/extensions/markdown.php(3889): YellowPage->parseContentShortcut('csv', 'test.csv', 'block')
#2 [internal function]: YellowMarkdownParser->_doAutoLinks_shortcutBlock_callback(Array)
#3 /home/account/public_html/yellowsite/system/extensions/markdown.php(3878): preg_replace_callback('/^\s\[(\w+)(....', Array, '[csv test.csv]')
#4 /home/account/public_html/yellowsite/system/extensions/markdown.php(669): YellowMarkdownParser->doAutoLinks('[csv test.csv]')
#5 /home/account/public_html/yellowsite/system/extensions/markdown.php(3518): MarkdownParser->runSpanGamut('[csv test.csv]')
#6 /home/account/public_html/yellowsite/system/extensions/markdown.php(613): MarkdownExtraParser- in /home/account/public_html/yellowsite/system/extensions/csv.php on line 22

I checked the server error.log, and there was nothing to see. 🤷‍♂️

So — it looks related to filename parsing somehow? If there's anything else I can do, please tell me! Thanks.

schulle4u commented 3 years ago

OK, it looks like your core extension is outdated. There was a small API change in recent versions, and I didn't care about backwards compatibility for the csv extension. Please update all extensions, then the error should be gone. If your browser doesn't show the updates, you could be affected by another issue. Sorry for the trouble. 😀

dajare commented 3 years ago

OK, it looks like your core extension is outdated.

Nailed it. That was easy enough! Thanks for the help.

The moral of the story: it pays to keep your system up to date!