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

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

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: ariamediaOn Tue, May 31, 2016 at 9:57 PM, davdav dd <@davdav_dd> wrote:

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


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+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/ab07f4c0-7c83-4f0f-8e90-2c11c3e7cee9%40googlegroups.com
https://groups.google.com/d/msgid/lucee/ab07f4c0-7c83-4f0f-8e90-2c11c3e7cee9%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

Don’t understand your answer but maybe this might help you. See Brian’s
blog post for details.

/**

/**

  • 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

On Tue, May 31, 2016 at 10:38 PM, davdav dd <@davdav_dd> wrote:

Hi,

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

On Tuesday, May 31, 2016 at 10:19:10 PM UTC+2, Nando Breiter wrote:

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

On Tue, May 31, 2016 at 9:57 PM, davdav dd david....@bccsolution.com wrote:

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


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
https://groups.google.com/d/msgid/lucee/ab07f4c0-7c83-4f0f-8e90-2c11c3e7cee9%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


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+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/2ccaa20e-3bde-487d-b298-a7e68db7ad38%40googlegroups.com
https://groups.google.com/d/msgid/lucee/2ccaa20e-3bde-487d-b298-a7e68db7ad38%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

Hi Mark,

Thanks for your help.

It is exactly what is not working with lucee!Le mardi 31 mai 2016 23:27:12 UTC+2, mark a écrit :

Try this.

http://stackoverflow.com/questions/19683868/display-cfloop-items-in-order-from-form

On Tuesday, May 31, 2016 at 2:57:46 PM UTC-5, davdav dd wrote:

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

Try this.
http://stackoverflow.com/questions/19683868/display-cfloop-items-in-order-from-formOn Tuesday, May 31, 2016 at 2:57:46 PM UTC-5, davdav dd wrote:

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

Hi,

This order is very important because a lot of pages are based on this
propertie to parse posted data. (tables)On Tuesday, May 31, 2016 at 10:19:10 PM UTC+2, Nando Breiter wrote:

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

On Tue, May 31, 2016 at 9:57 PM, davdav dd <david....@bccsolution.com <javascript:>> wrote:

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


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 <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/ab07f4c0-7c83-4f0f-8e90-2c11c3e7cee9%40googlegroups.com
https://groups.google.com/d/msgid/lucee/ab07f4c0-7c83-4f0f-8e90-2c11c3e7cee9%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

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-871Le mardi 31 mai 2016 21:57:46 UTC+2, davdav dd a écrit :

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