Lucee 6 adds new component metadata with null values

Description

Looping over component metadata is a very common practice in CFML. However, in Lucee 6, we need to do an isNull() check because there are new metadata keys with null values:

for ( var thisKey in getComponentMetadata( this ) ) { variables[ thisKey ] = arguments.md[ thisKey ]; }

This throws

the value from key [subname] is NULL, which is the same as not existing in CFML

This is breaking the current ColdBox build on the Lucee 6 beta.

 

It seems there are at least 2 new metadata keys which do not correspond to CFML code:

  • sub

  • subname

Perhaps more.

Environment

Lucee 6.0.0.346-BETA

Activity

Pothys - MitrahSoft 30 March 2023 at 14:15

I've checked this ticket with Lucee 6.0.0.357-SNAPSHOT and Now the component key subname doesn't return NULL value and the issue is solved.

Zac Spitzer 29 March 2023 at 08:15

Zac Spitzer 29 March 2023 at 08:12

https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-e-g/getmetadata.html

fullname - The dot-delimited path from the cf_webroot of the component. name - Component name, including the period-delimited path from a component search root such as the web root or a directory specified in the administrator Custom Tag Paths page.

not sure if it’s problem having the same value for name and fullname ?

Zac Spitzer 29 March 2023 at 06:37

as per the rejected task, the null checking is not the only issue note also checking fullname but using name

Pothys - MitrahSoft 15 March 2023 at 08:11
Edited

I added a fix & testcase to add null checking to component metadata key
Pull Request: https://github.com/lucee/Lucee/pull/1981

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Created 14 March 2023 at 14:47
Updated 31 March 2023 at 08:19
Resolved 31 March 2023 at 08:19