Using $CPF_LIST w/ fractional editing
Posted
#3609
(In Topic #722)
According to the documentation, fractional editing requires a list separated by a |
$CPF_LIST returns all values separated with a comma and oddly repeats the value. Example:
Code
value1=value1,value2=value2,value3=value3, etc.I imagine I can surround $CPF_LIST with $REPLACE to replace the commas with |, but I'm not sure how to remove the value= part (CPF values all contain different amounts of characters as well).
Posted
First, I had to make a few fixes:
https://github.com/ocproducts/composr/commit/8e947c532181155ea698b1185b308562162121ea
Then I did it like:
Code
{$SET,edit_type,{$SUBSTR,{$PREG_REPLACE,(^|\,)([^=]*)=([^\,]*),|$2,{$CPF_LIST,Currency code}},1}}
(I just used Currency code as that is a default CPF with a list that I could test with).
Posted
https://github.com/ocproducts/composr/commit/71cfbb817a99646226541f2719fd3b96326d8473
Code
{$SET,edit_type,{$CPF_LIST,Currency code,|,0}}
Posted
This was working but no longer does. Not sure what happened. Instead of showing a dropdown, it just shows a text field now, almost like it's ignoring $SET.
I don't recall upgrading my installation since you've posted this. It's possible but I'm unsure. I compared both CPF_LIST.php on Github and in my installation, they are both the same.
Is it possible something else could've affected this?
It's not too big of a deal - I'd rather it be dynamic in case I make a change to one of the CPF drop down values so then it'll update on its own when using fractional editing, but worse case scenario I can just manually hard code the drop down values.
1 guest and 0 members have recently viewed this.
