Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lucee 6 - SpreadsheetAddRows() Error #30

Open
spraguey opened this issue Aug 9, 2024 · 6 comments
Open

Lucee 6 - SpreadsheetAddRows() Error #30

spraguey opened this issue Aug 9, 2024 · 6 comments

Comments

@spraguey
Copy link

spraguey commented Aug 9, 2024

I'm getting the following error when I run SpreadsheetAddRows().

Message: 'double lucee.runtime.functions.math.Min.call(lucee.runtime.PageContext, double, double)'
Type: java.lang.NoSuchMethodError
Tag Context:| /org/cfpoi/spreadsheet/Spreadsheet.cfc [2952]

I extracted and opened spreadsheet.cfc, and I see the following on line 2952:
return Min( Local.width, (255*256) );

I'm not having much luck trying to find this error on Google.

@spraguey
Copy link
Author

spraguey commented Aug 9, 2024

In case it helps, this is the block of code running it. This was working with Lucee 5. It errors on the 4th line.

<cfset spObj = spreadsheetNew(xmlFormat="true")>
<cfset spreadsheetAddRow(spObj, arguments.fieldlabels)>
<cfset spreadsheetFormatRow(spObj, {bold="true"}, 1)>
<cfset spreadsheetAddRows(spObj, arguments.query,2,1)>

@spraguey
Copy link
Author

spraguey commented Aug 11, 2024

I was able to write some simple replacement code to get around this, but I can't figure out how to deploy it. Can anyone help? @Leftbower ?

I extracted spreadsheet.cfc from cfc-archive-cfspreadsheet.lar. I make the following change to replace the Min function call.

if (Local.width LTE (255*256)) {
	return Local.width;
} else {
	return (255*256);
}

I then re-compress cfc-archive-cfspreadsheet.lar with the changed file and restart Lucee.

I still get the exact same error on the same line number, and the debugging shows the same old Min() line that I replaced. Could it be something to do with the spreadsheet_cfc$cf.class in the archive? Or does cfspreadsheet.cfc also exist in another place besides the LAR file?

@Leftbower
Copy link
Owner

Yes, Lucee is picking up the original, compiled class file which doesn't have your changes. You need to replace that with the newlsy compiled class file that includes your updates.

@spraguey
Copy link
Author

I guess that is the piece of the puzzle I am missing. I don’t know how to generate the class file.

@Leftbower
Copy link
Owner

You can do it from within the Lucee admin. Navigate to the Component section under Archives & Resources. There are a number of tools/settings in there (my apologies... it's been a long time since I've looked at this).

@spraguey
Copy link
Author

If anyone else runs into this issue, here is a fixed LAR file you can use.
cfc-archive-cfspreadsheet.lar.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants