migrate from ACF 9 to Lucee 5 express (test):

93 views
Skip to first unread message

davdav dd

unread,
May 31, 2016, 3:57:46 PM5/31/16
to Lucee
Hi,

I am new to lucee, and doing some test to perhaps migrate.

I have a big problem with posted data from forms.

In ACF, when using Form.FieldNames, the fields order are in the same order as the fields presented on the form,
but with Lucee the order change, and this is a big problem for me.

Any idea what to do to keep the order?

Regards,
David

Nando Breiter

unread,
May 31, 2016, 4:19:10 PM5/31/16
to lu...@googlegroups.com
David,

Why is the order important to you? Maybe there is another less fragile way of accomplishing what you need. 



Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/ab07f4c0-7c83-4f0f-8e90-2c11c3e7cee9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

davdav dd

unread,
May 31, 2016, 4:38:38 PM5/31/16
to Lucee
Hi,

This order is very important because a lot of pages are based on this propertie to parse posted data. (tables)

Nando Breiter

unread,
May 31, 2016, 5:05:33 PM5/31/16
to lu...@googlegroups.com
Don't understand your answer but maybe this might help you. See Brian's blog post for details. 

/**
 * Adapted from Brian Kotek's FormUtilities.cfc
 */
component {

/**
* I convert form field names containing dots and / or brackets into structs and / or arrays
* for convenient form variable processing on submission of nested trees of values
*/
public struct function buildFormCollections( struct formScope ) {
var local = {};
local.tempStruct = {};
local.tempStruct['formCollectionsList'] = "";

for (local.thisField in arguments.formScope) {
local.thisField = trim(local.thisField);
// if the fieldname has a dot or a bracket ...
if ( hasFormCollectionSyntax(local.thisField) ) {
// add collection to list if not present
local.tempStruct['formCollectionsList'] = addCollectionNameToCollectionList(local.tempStruct['formCollectionsList'], local.thisField);
local.currentElement = local.tempStruct;
// loop over the field using . as the delimiter
local.delimiterCounter = 1;
for (var i = 1; i <= ListLen( local.thisField, '.' ); i++ ) {
local.thisElement = ListGetAt( local.thisField, i, '.' );
local.tempElement = local.thisElement;
local.tempIndex = 0;
// if the current portion of the field has a bracket, determine the index and the element name
if ( local.tempElement contains "[" ) {
local.tempIndex = ReReplaceNoCase(local.tempElement, '.+\[|\]', '', 'all');
local.tempElement = ReReplaceNoCase(local.tempElement, '\[.+\]', '', 'all');
}
// if there is a temp element defined, this field is an array or struct
if ( !StructKeyExists( local.currentElement, local.tempElement ) ) {
// if tempIndex is 0, it's a struct, otherwise it's an array
if ( local.tempIndex eq 0 ) {
local.currentElement[local.tempElement] = {};
} else {
local.currentElement[local.tempElement] = [];
}
}
// if this is the last element defined by dots in the form field name, assign the form field value to the variable
if ( local.delimiterCounter eq ListLen(local.thisField, '.') ) {
if ( local.tempIndex eq 0 ) {
local.currentElement[local.tempElement] = arguments.formScope[local.thisField];
} else {
local.currentElement[local.tempElement][local.tempIndex] = arguments.formScope[local.thisField];
}
// otherwise, keep going through the field name looking for more structs or arrays
} else {
// if this field was a Struct, make the next element the current element for the next loop iteration
if ( local.tempIndex eq 0 ) {
local.currentElement = local.currentElement[local.tempElement];
} else {
if ( ArrayIsEmpty(local.currentElement[local.tempElement])
or ArrayLen(local.currentElement[local.tempElement]) lt local.tempIndex
or not ArrayIsDefined(local.currentElement[local.tempElement], local.tempIndex) ) {

local.currentElement[local.tempElement][local.tempIndex] = {};
}
//  Make the next element the current element for the next loop iteration
local.currentElement = local.currentElement[local.tempElement][local.tempIndex];
}

local.delimiterCounter = local.delimiterCounter + 1;

}
}
}
}
return local.tempStruct;
}

/**
* I determine if the field has the form collection syntax, meaning it contains a dot or a bracket
*
*/
private boolean function hasFormCollectionSyntax( fieldName ) {
return arguments.fieldName contains "." or arguments.fieldName contains "[";
}

/**
* I add the collection name to the list of collection names if it isn't already there
*
*/
private string function addCollectionNameToCollectionList( string formCollectionsList, string fieldName ) {
if ( !ListFindNoCase( arguments.formCollectionsList, ReReplaceNoCase( arguments.fieldName, '(\.|\[).+', '' ) ) ) {
arguments.formCollectionsList = ListAppend( arguments.formCollectionsList, ReReplaceNoCase( arguments.fieldName, '(\.|\[).+', '' ) );
}
return arguments.formCollectionsList;
}
}




Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

mark

unread,
May 31, 2016, 5:27:12 PM5/31/16
to Lucee

davdav dd

unread,
May 31, 2016, 5:31:56 PM5/31/16
to Lucee
Hi Mark,

Thanks for your help.

It is exactly what is not working with lucee!

davdav dd

unread,
Jun 11, 2016, 3:37:11 AM6/11/16
to Lucee
This problem as been accepted as a bug and resolved by LAS.

Thanks to the team!

Just have to wait the next release....
Any idea when?


https://luceeserver.atlassian.net/browse/LDEV-871

Andrew Dixon

unread,
Jun 11, 2016, 6:11:43 AM6/11/16
to lu...@googlegroups.com
Hi David,

As it has already been "deployed" you can get it today from the snapshot provider, either in the admin or directly from:


This is true for anything in JIRA that is marked as "deployed" and has a "fix version" set.

Kind regards,

Andrew

--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Mark Drew

unread,
Jun 11, 2016, 7:12:10 AM6/11/16
to lu...@googlegroups.com
But Andrew, I wanted to wait 12-18 months so that it matches ACF release times!!!

I am logging a bug! ;)



Mark Drew
- Sent by typing with my thumbs. 

davdav dd

unread,
Jun 11, 2016, 7:40:55 AM6/11/16
to Lucee
Hi Mark,

Very thanks for this info....

But the express setup doesnt download....

message:
{"message":"The version 5.0.1.8-SNAPSHOT is not available.","type":"error"}

Regards,

David
Reply all
Reply to author
Forward
0 new messages