AnsweredAssumed Answered

Strange JavaScript API behavior

Question asked by simon on Jul 3, 2006
Latest reply on Jul 3, 2006 by simon
Alfresco,

I'm testing the new JavaScript API features in 1.3 and they look nice. The default simple Backup script works fine. I changed line 14 from copy.name = "backup of" + copy.name; to:
copy.name = copy.name; 
This still works, no problems here but it seems like a totally useless line, it assigns the the variable to itself. So I removed the line and tested this again… but ran into the following error:
An error occurred

Failed to update category due to system error: Transaction didn't commit: Failed to execute script 'workspace://SpacesStore/f900e25e-0a69-11db-b76c-410603f2342f': Wrapped java.lang.NullPointerException (AlfrescoScript#14)
It works again when I put the "copy.name" line back in place. Why is this?

I'm still on Alfresco 1.3 preview, if this is a bug it could be fixed in 1.3, is it?

Thanks!

Outcomes