I imported a spreadsheet, APMlijst.xlsx through an INCLUDE statement in my script. It worked fine.
Then, I imported the same spreadsheet into the runtime importer. It failed with the message: Class "Ampersand\Exception\NotDefined\ConceptNotDefined" not found.
When I opened the mistake (see the screenshot), I got a lot of text that did not help me. I also opened the log file. That didn't help me either. I experimented with the .xlsx file, without luck.
What I expected
I expected some help to diagnose this mistake.
Diagnosis
It took me a journey into the PHP code of ExcelImporter.php to find the cause. I discovered that some of the names of worksheets correspond with the names of interfaces in my Ampersand script. As a result, the ExcelImporter calls parseWorksheetWithIfc instead of parseWorksheet.
Proposed solution
I suggest we build in a more meaningful error message, to save the victims of this mistake a lot of time. Since good error messages are a necessity, I consider this a bug rather than a feature.
Version of ampersand that was used
Steps to reproduce
Write an Ampersand script with an interface named "Diensten"
Write a spreadsheet with a worksheet called "Diensten", ensuring that this imports correctly when INCLUDEd in the script, but not according to the INTERFACE conventions (to reproduce the mistake)
Run the prototype
Import the spreadsheet in the runtime Excel-importer.
What happened
I imported a spreadsheet,
APMlijst.xlsx
through anINCLUDE
statement in my script. It worked fine. Then, I imported the same spreadsheet into the runtime importer. It failed with the message:Class "Ampersand\Exception\NotDefined\ConceptNotDefined" not found
.When I opened the mistake (see the screenshot), I got a lot of text that did not help me. I also opened the log file. That didn't help me either. I experimented with the .xlsx file, without luck.
What I expected
I expected some help to diagnose this mistake.
Diagnosis
It took me a journey into the PHP code of
ExcelImporter.php
to find the cause. I discovered that some of the names of worksheets correspond with the names of interfaces in my Ampersand script. As a result, the ExcelImporter callsparseWorksheetWithIfc
instead ofparseWorksheet
.Proposed solution
I suggest we build in a more meaningful error message, to save the victims of this mistake a lot of time. Since good error messages are a necessity, I consider this a bug rather than a feature.
Version of ampersand that was used
Steps to reproduce