Wow, I have to say that trying to figure out how to work certain custom CC features on my own is not easy. But there is so much more help for CF than CC. But I digress.
I have two issues right now when trying to edit an input. The record includes a Multiple Select input (separated by comma-space(, ). When I go to edit the record, nothing shows up. I tried to use a Multiple Record loader and that didn't work. So can someone point me to where I can find the answer as to how to populate a Multiple Select input box?
Also, there is an uploaded image that goes along with the record. But if they don't upload an image, a placeholder image is put in place. When I go to edit the record, it wants me to upload a new picture. If I use a Text Box instead of an image uploader, then it shows the correct image name. But what if the user wants to change the image? Is there an easy way to say, if there is no new uploads, then keep what's there in the DB, if not, upload the new one and update the record?
I was thinking about just including a link to another form that lets them only upload a new image. Which way would be best?
Thanks,
Mike
I have two issues right now when trying to edit an input. The record includes a Multiple Select input (separated by comma-space(, ). When I go to edit the record, nothing shows up. I tried to use a Multiple Record loader and that didn't work. So can someone point me to where I can find the answer as to how to populate a Multiple Select input box?
Also, there is an uploaded image that goes along with the record. But if they don't upload an image, a placeholder image is put in place. When I go to edit the record, it wants me to upload a new picture. If I use a Text Box instead of an image uploader, then it shows the correct image name. But what if the user wants to change the image? Is there an easy way to say, if there is no new uploads, then keep what's there in the DB, if not, upload the new one and update the record?
I was thinking about just including a link to another form that lets them only upload a new image. Which way would be best?
Thanks,
Mike
Hi Mike,
I'm afraid it's true that there is more support for ChronoForms. I probably build ten-twenty forms for every listing so am much more familiar with ChronoForms; and whilst I can usually build a test form in a few minutes a test listing takes much longer. And there are a lot of possible settings :-(
If you are re-loading a single record to edit use the DB Record Loader which has an array fields option on the Advanced tab. I think that someone posted yesterday that there is a similar option in ChronoConnectivity.
Please see this FAQ for some suggestions for the images.
Bob
I'm afraid it's true that there is more support for ChronoForms. I probably build ten-twenty forms for every listing so am much more familiar with ChronoForms; and whilst I can usually build a test form in a few minutes a test listing takes much longer. And there are a lot of possible settings :-(
If you are re-loading a single record to edit use the DB Record Loader which has an array fields option on the Advanced tab. I think that someone posted yesterday that there is a similar option in ChronoConnectivity.
Please see this FAQ for some suggestions for the images.
Bob
Bob,
Looks like that FAQ on the image is exactly what I am looking for.
I tried using the DB Record Loader but it doesn't seem to be working.
Is there anywhere out there that might show a sample of the settings? It's possible I have it set up incorrectly. I have attached screen shots of the settings.
I am loading this before the HTML. I tried loading it after and it still wasn't working.
Thanks for your help on this. It's the last thing I need to figure out to finish this job.๐
Mike
Looks like that FAQ on the image is exactly what I am looking for.
I tried using the DB Record Loader but it doesn't seem to be working.
Is there anywhere out there that might show a sample of the settings? It's possible I have it set up incorrectly. I have attached screen shots of the settings.
I am loading this before the HTML. I tried loading it after and it still wasn't working.
Thanks for your help on this. It's the last thing I need to figure out to finish this job.๐
Mike
Well, the image thing almost works.
I can get the image to display. I have all of the settings in place correctly. I can even delete the image. But then again, it deletes always. It said to put a "Delete Image" checkbox in place, but I added a "Yes/No" option to force a "No" on delete image. I have the custom code loaded before the file upload, but no matter what, it deletes the image.
I can get the image to display. I have all of the settings in place correctly. I can even delete the image. But then again, it deletes always. It said to put a "Delete Image" checkbox in place, but I added a "Yes/No" option to force a "No" on delete image. I have the custom code loaded before the file upload, but no matter what, it deletes the image.
Hi applebox,
As far as I know the code in the FAQ works - though there is a conversation in a thread here. What do you see if you add a debugger? Does that give you any clues? Is there a ghost option on the Yes/No select that gives a result you don't expect?
Bob
As far as I know the code in the FAQ works - though there is a conversation in a thread here. What do you see if you add a debugger? Does that give you any clues? Is there a ghost option on the Yes/No select that gives a result you don't expect?
Bob
Well, as I suspected I'm sure I have a setting wrong with the DB Record Loader. I've attached the error I'm getting.
As for the Image, I have a ghost on the Yes/No but it's not throwing up any errors. What do you mean "there is a conversion in a thread here"? Do you mean how to make that apply to my situation? I think everything is set up properly. It shows the image just fine and if I upload a new one it's fine. The only thing not working is when I leave it alone. I can change or delete, but I can't leave it alone.
Mike
As for the Image, I have a ghost on the Yes/No but it's not throwing up any errors. What do you mean "there is a conversion in a thread here"? Do you mean how to make that apply to my situation? I think everything is set up properly. It shows the image just fine and if I upload a new one it's fine. The only thing not working is when I leave it alone. I can change or delete, but I can't leave it alone.
Mike
Bob,
Any clues on this yet? I would really love to get this finished over the weekend.
Thanks so much.
Mike
Any clues on this yet? I would really love to get this finished over the weekend.
Thanks so much.
Mike
Hi Mike,
The WHERE clause is incomplete, I think that this is the problem. Please try putting 1 = 1 in the WHERE box.
Bob
The WHERE clause is incomplete, I think that this is the problem. Please try putting 1 = 1 in the WHERE box.
Bob
Ok, I view this as progress anyway. Now it's returning all of the selected items into the array (image upload 1), but the Selection Box is not being fully populated (only the first one is selected - image upload 2). In the DB Record Loader, I made sure to put the proper array separator in place, but that doesn't seem to be the problem.
Does this help with finishing off whatever code I need to put in place?
Thanks for the input,
Mike
Does this help with finishing off whatever code I need to put in place?
Thanks for the input,
Mike
I have tried a few things more using code but no luck yet.
I tried using some loops and if statements and this is as far as I got.
There has to be a way to do this. Why have the ability to have multiple selects if there is no way to recall them?
I tried using some loops and if statements and this is as far as I got.
There has to be a way to do this. Why have the ability to have multiple selects if there is no way to recall them?
Hi. Are you editing the record by calling the form via Chronoconnectivity view?
If yes, see http://www.chronoengine.com/forums.html?cont=posts&f=3&t=90059. You need to "declare" the multi select arrays (or multi checkboxes) on CC view, and not on CF. at least, this procedure works for me.
Good luck.
If yes, see http://www.chronoengine.com/forums.html?cont=posts&f=3&t=90059. You need to "declare" the multi select arrays (or multi checkboxes) on CC view, and not on CF. at least, this procedure works for me.
Good luck.
neuronageek,
Thanks so much for your input. What you are explaining is exactly what I need to do. However, for some reason it's not working. If I use the DB Record Loader, I at least get the first array value populated in the select box. I can't get the other values in place. If I use your method, the commas disappear from the results page (not the edit page) and puts them into on concatenated string so that when I choose to edit that record, nothing appears in the select box. If I delete the DB Record Loader, then it doesn't change. I am listing ", " as the array separator but that doesn't seem to affect anything.
So maybe the problem lies in the settings of both the form and the CC view, I'm not sure.
I guess I need to know if I still need to use the DB Record Loader on the form side. It sounds to me like you are not using that. But like I said, if I do away with that, then I get no results in the edit form. Maybe I'm missing something on the CC View side because I think I am close. If I do away with the DB Record loader, and use your method, it would work if I could get things back into an array. For some reason, it's taking the array, turning it into a string so that when I go to edit the record, it's looking at the result as a string and not an array. If I do away with the array separator, that still doesn't fix it. Very frustrating right now.
Thanks so much for your input. What you are explaining is exactly what I need to do. However, for some reason it's not working. If I use the DB Record Loader, I at least get the first array value populated in the select box. I can't get the other values in place. If I use your method, the commas disappear from the results page (not the edit page) and puts them into on concatenated string so that when I choose to edit that record, nothing appears in the select box. If I delete the DB Record Loader, then it doesn't change. I am listing ", " as the array separator but that doesn't seem to affect anything.
So maybe the problem lies in the settings of both the form and the CC view, I'm not sure.
I guess I need to know if I still need to use the DB Record Loader on the form side. It sounds to me like you are not using that. But like I said, if I do away with that, then I get no results in the edit form. Maybe I'm missing something on the CC View side because I think I am close. If I do away with the DB Record loader, and use your method, it would work if I could get things back into an array. For some reason, it's taking the array, turning it into a string so that when I go to edit the record, it's looking at the result as a string and not an array. If I do away with the array separator, that still doesn't fix it. Very frustrating right now.
Hi, Applebox.
In my form, the form fields with "multi" capabilities does not came from a DB record loader. In my form, I also do not use a DB Record loader, but a DB Multi Record Loader to retrieve data from a bar/restorants places using a key name in the main table.
This are the settings of this loader, (the same you can see on the referenced post earlier):
[attachment=0]1.jpg[/attachment]
Please note that the multi fields are created in the form, and declared IN CC advanced tab!!
Again, good luck!
In my form, the form fields with "multi" capabilities does not came from a DB record loader. In my form, I also do not use a DB Record loader, but a DB Multi Record Loader to retrieve data from a bar/restorants places using a key name in the main table.
This are the settings of this loader, (the same you can see on the referenced post earlier):
[attachment=0]1.jpg[/attachment]
Please note that the multi fields are created in the form, and declared IN CC advanced tab!!
Again, good luck!
Hi Mike,
In the DB Record Loader have you added element name in the the Array Fields Sets box?
Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.
Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.
Bob
In the DB Record Loader have you added element name in the the Array Fields Sets box?
Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.
Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.
Bob
Feel free to bacup the form a post -or send me- a copy to examine the form this weekend. Include also the Chronoconnectivity view.
Bob,
I do have the field name in the Array Fields Set Box.
But now I just noticed another BIG issue. For some reason, the item that I am selecting to edit is not the record that is getting edited. This was working before, but somewhere along the way it broke. No matter what record I select, I end up editing the last record entered.
neuronageek,
What exactly do you need to see? The backend settings in admin or the custom code I am using in CC?
I apparently have a lot of issues going on so I'm not sure what is going to give you the information you are seeking.
Thanks,
Mike
I do have the field name in the Array Fields Set Box.
But now I just noticed another BIG issue. For some reason, the item that I am selecting to edit is not the record that is getting edited. This was working before, but somewhere along the way it broke. No matter what record I select, I end up editing the last record entered.
neuronageek,
What exactly do you need to see? The backend settings in admin or the custom code I am using in CC?
I apparently have a lot of issues going on so I'm not sure what is going to give you the information you are seeking.
Thanks,
Mike
Well, the new problem was due to the WHERE 1=1 check that Bob had me put in there. But taking it out now gives no returns on the array. So my thoughts are that this could all be cleared with a correct WHERE statement. But programming is my second nature, not my first so I need some help๐
Been a few days and just thought I would check in to see if there were any thoughts?
Hello,
This is a long topic, what's the current problem ?
Regards,
Max
This is a long topic, what's the current problem ?
Regards,
Max
Max,
Currently I have two issues. The biggest issue is that I can't get the edit form to populate a multiple select with the array of items that are in the database. The most I can do is have the first item in the array populated.
The other problem lies in the image that was uploaded. When I go into edit mode, it shows the image, but if I choose not to do anything with the image (in other words keep that one in place), it deletes it from the database. I've tried the fix from the FAQ here on the site, but that doesn't seem to work. I even tried populating a text box with that data and using some logic like, if that is empty, then do nothing. But that's not working either.
As I have stated, coding is my second strength, not my first. So I'm a bit at a loss in trying to figure out how to fix this issue. I know it all has to do with the settings in either the CC or the CF (I'm thinking the ChronoForm that I have set up to edit the info).
So any help you can give would be great. If you need access to the site, let me know.
Thanks,
Mike
Currently I have two issues. The biggest issue is that I can't get the edit form to populate a multiple select with the array of items that are in the database. The most I can do is have the first item in the array populated.
The other problem lies in the image that was uploaded. When I go into edit mode, it shows the image, but if I choose not to do anything with the image (in other words keep that one in place), it deletes it from the database. I've tried the fix from the FAQ here on the site, but that doesn't seem to work. I even tried populating a text box with that data and using some logic like, if that is empty, then do nothing. But that's not working either.
As I have stated, coding is my second strength, not my first. So I'm a bit at a loss in trying to figure out how to fix this issue. I know it all has to do with the settings in either the CC or the CF (I'm thinking the ChronoForm that I have set up to edit the info).
So any help you can give would be great. If you need access to the site, let me know.
Thanks,
Mike
Just another ping to see if anyone has anything more to offer here. There has got to be a solution for this. Why have the ability to have multiple selections in a form if you can't edit those multiple selections? Surely this has to have come up before. Or am I seriously the first person to ever try doing this?
Sorry if sarcasm doesn't translate well in type๐
Sorry if sarcasm doesn't translate well in type๐
Hi applebox,
As far as I am aware it's possible to edit multiple selections if you get the array settings correct; I also believe that the image management FAQ works OK.
Please drag a Debugger action into the On Load event, then view the form and post the results here.
Bob
As far as I am aware it's possible to edit multiple selections if you get the array settings correct; I also believe that the image management FAQ works OK.
Please drag a Debugger action into the On Load event, then view the form and post the results here.
Bob
Bob,
I did this before and I'm not seeing any "errors". Does that mean there are no problems? No, just no errors. Here is what is being returned...
The array "available_parts" is what I am trying to retrieve. You can see that the string is there, but every suggestion that I have been given so far does not work. The best I can do is have the select box populate the very first array value.
Can you learn anything from this?
Thanks,
Mike
I did this before and I'm not seeing any "errors". Does that mean there are no problems? No, just no errors. Here is what is being returned...
Data Array:
Array
(
[lang] => en_US
[language] => en-US
[format] => html
[Itemid] => 628
[option] => com_chronoconnectivity
[task] => cc_edit_data
[cb] => 3
[cf_id] => 3
[cf_uid] => 5a0e000f0e4d830013d9b64159417947
[cf_created] => 2013-06-20 19:04:57
[cf_modified] => 2013-06-27 07:24:53
[cf_created_by] => 42
[cf_modified_by] => 42
[cf_ipaddress] => 96.236.138.147
[cf_user_id] => 42
[first_letter] => B
[song_title] => Bring it Home
[composer] => Big Daddy Badass
[yearpublished] => 1902
[available_parts] => Complete Score, Violin, Guitar
[lyrics] => No
[vocal_type] => Baritone
[vocal_type_other] =>
[nationality] => Serbian
[nationality_other] =>
[region] =>
[song_type] => Polka
[song_type_other] =>
[donation] => No
[library] => Serbian National
[publisher] => Iceberg
[key_signature] => MMK
[sheet_music_image] => 20130627072453_IMG_9463.jpg
)
Validation Errors:
Array
(
)
The array "available_parts" is what I am trying to retrieve. You can see that the string is there, but every suggestion that I have been given so far does not work. The best I can do is have the select box populate the very first array value.
Can you learn anything from this?
Thanks,
Mike
Hi,
Sorry for not posting sooner!
How do you have the data loaded ? using Chronoforms or Connectivity ?
In case you load it using CF, then in either the "db record loader" or the "db multi record loader", there is a setting to set array fields names (use available_parts) and the separator, use ", " (with space)
In case you load it using CC then there is a similar setting under the "General > advanced" tab
I hope this helps!
Regards,
Max
Sorry for not posting sooner!
How do you have the data loaded ? using Chronoforms or Connectivity ?
In case you load it using CF, then in either the "db record loader" or the "db multi record loader", there is a setting to set array fields names (use available_parts) and the separator, use ", " (with space)
In case you load it using CC then there is a similar setting under the "General > advanced" tab
I hope this helps!
Regards,
Max
Thanks Max,
I am pretty sure I have tried this both ways.
I am using CF to edit the information from a CC page that displays the data.
I have tried the settings in both areas you are talking about and neither seemed to work.
I've attached two screen shots (I thought I did this before) of how the settings are right now in the CF form and it loads nothing.
Is there something that needs to go into the WHERE box? Bob suggested I try 1=1 and when I did that, only the first array value loaded. So that's why I'm thinking that something is missing in the WHERE clause.
I am pretty sure I have tried this both ways.
I am using CF to edit the information from a CC page that displays the data.
I have tried the settings in both areas you are talking about and neither seemed to work.
I've attached two screen shots (I thought I did this before) of how the settings are right now in the CF form and it loads nothing.
Is there something that needs to go into the WHERE box? Bob suggested I try 1=1 and when I did that, only the first array value loaded. So that's why I'm thinking that something is missing in the WHERE clause.
Sorry to be a pest, we are really trying to nail this down for launch this week.
Any thoughts?
Thanks,
Mike
Any thoughts?
Thanks,
Mike
Hi Mike,
If you are using CF then please drag a "Debugger" action after the "db loader" action and check the loaded data structure.
Why do you have "available_parts" in the "DB Field" box ? please remove that and use 1=1 in the WHERE box instead as Bob has suggested.
Let us know the results.
Regards,
Max
If you are using CF then please drag a "Debugger" action after the "db loader" action and check the loaded data structure.
Why do you have "available_parts" in the "DB Field" box ? please remove that and use 1=1 in the WHERE box instead as Bob has suggested.
Let us know the results.
Regards,
Max
Max,
I did use the debugger and I've posted the results (if you look up a few posts ago.
I am using available_parts in the DB Field Box because that is the name of the field that I am tapping. Should I not do that?
I tried the WHERE 1=1 and it would only load the first result.
I've posted all of these findings before, but I guess they are getting buried in the thread.
Not sure if I tried removing the available_parts in the DB Field box, but how else will it know what field to look for?
Thanks,
Mike
I did use the debugger and I've posted the results (if you look up a few posts ago.
I am using available_parts in the DB Field Box because that is the name of the field that I am tapping. Should I not do that?
I tried the WHERE 1=1 and it would only load the first result.
I've posted all of these findings before, but I guess they are getting buried in the thread.
Not sure if I tried removing the available_parts in the DB Field box, but how else will it know what field to look for?
Thanks,
Mike
Just tried it what it's doing is selecting the first choice in the list regardless of what the data is. So that method doesn't work.
I just feel this has to be something simple that I'm missing. I can't be the only one who has ever tried to load multiple choices into an edit form? Or can I?
I just feel this has to be something simple that I'm missing. I can't be the only one who has ever tried to load multiple choices into an edit form? Or can I?
Well, the key is to get the "available_parts" field in the loaded data array converted into an array, instead of a concatenated string.
Although the array fields configuration looks good, I don't know why it didn't work, you may do it manually by using a custom code action after the db loader and use this code:
Then drag the the debugger after that and verify that the "available_parts" is now an array ?
Regards,
Max
Although the array fields configuration looks good, I don't know why it didn't work, you may do it manually by using a custom code action after the db loader and use this code:
<?php
$form->data["available_parts"] = explode(", ", $form->data["available_parts"]);
?>
Then drag the the debugger after that and verify that the "available_parts" is now an array ?
Regards,
Max
Thanks Max.
I'm getting an error on your code:
Warning: explode() expects parameter 2 to be string, array given in .../components/com_chronoforms/form_actions/custom_code/custom_code.php(19) : eval()'d code on line 2
It's not populating the select box and in the debugging code, it's not showing the array (probably because of the error above). It's displaying the array properly on the results page.
I pasted the code exactly how you showed and to me, it looks like it has to parameters, so I'm not sure what could be causing this.
I'm getting an error on your code:
Warning: explode() expects parameter 2 to be string, array given in .../components/com_chronoforms/form_actions/custom_code/custom_code.php(19) : eval()'d code on line 2
It's not populating the select box and in the debugging code, it's not showing the array (probably because of the error above). It's displaying the array properly on the results page.
I pasted the code exactly how you showed and to me, it looks like it has to parameters, so I'm not sure what could be causing this.
Hi Applebox,
That's not an *Error* it's a notice and what it tells you is that $form->data["available_parts"] is already an array so you may not need to covert it.
Bob
That's not an *Error* it's a notice and what it tells you is that $form->data["available_parts"] is already an array so you may not need to covert it.
Bob
Ok, so if I don't use the code that Max gave me, the multiple select box only populates the very first word in the array and nothing else. I also noticed that, if I take the WHERE 1=1 statement out, the Data Array printout is different. Looks like this:
[available_parts] => Celo, Celovic, Berde/Bass, Violin, Guitar
If I do have it in, the results look like this:
[available_parts] => Array
(
[0] => Celo
[1] => Celovic
[2] => Berde/Bass
[3] => Violin
[4] => Guitar
)
Does this help in any way?
[available_parts] => Celo, Celovic, Berde/Bass, Violin, Guitar
If I do have it in, the results look like this:
[available_parts] => Array
(
[0] => Celo
[1] => Celovic
[2] => Berde/Bass
[3] => Violin
[4] => Guitar
)
Does this help in any way?
Hi,
This is the result you need:
So just have it like this and it should populate the dropdown with those 5 values, or it doesn't ?
Regards,
Max
This is the result you need:
[available_parts] => Array
(
[0] => Celo
[1] => Celovic
[2] => Berde/Bass
[3] => Violin
[4] => Guitar
)
So just have it like this and it should populate the dropdown with those 5 values, or it doesn't ?
Regards,
Max
I am getting that in the printout from the debugger, but the field is not populating. It's only populating the first one in the array.
Its a dropdown of type multiple and its name has [], correct ? it should populate with any array value, assuming the field name matching the data structure, what's the dropdown field name and what does the debug output for the data section now ?
Regards,
Max
Regards,
Max
Max,
It's a multi-select box so all of the choices are exposed. The field name is the same available_parts. The debug prints out the correct array as I posted before the results. It's just not populating the field correctly. It's only putting the very first one in place.
Would it be easier for me to give you an admin id and password via PM to check it out?
Thanks,
Mike
It's a multi-select box so all of the choices are exposed. The field name is the same available_parts. The debug prints out the correct array as I posted before the results. It's just not populating the field correctly. It's only putting the very first one in place.
Would it be easier for me to give you an admin id and password via PM to check it out?
Thanks,
Mike
On a side note, the problem I was having before with the image updates was solved. So that just leaves this issue.
My clients really want to launch this portion of their site this week so hopefully we can get this figured out.
I noticed two checkboxes on the form element: "Add to a Multi-field Row" and "Start a Multi-field Row".
Would this have anything to do with the issue? Just throwing something out there.
My clients really want to launch this portion of their site this week so hopefully we can get this figured out.
I noticed two checkboxes on the form element: "Add to a Multi-field Row" and "Start a Multi-field Row".
Would this have anything to do with the issue? Just throwing something out there.
Hi applebox,
The "Add to a Multi-field Row" and "Start a Multi-field Row" options are about the way elements are laid out in the form and so should have zero effect on this.
Bob
The "Add to a Multi-field Row" and "Start a Multi-field Row" options are about the way elements are laid out in the form and so should have zero effect on this.
Bob
Ok, It's just that we've been going back and forth for over a month on this and it's still not solved.
I honestly thought this was an easy one to figure out. CF has the choice of a Multi-Select element.
Therefore, it's only safe to assume that one should be able to populate one on a form for editing purposes.
But maybe I'm the first to try to attempt such a feat.
I guess the good news is, once we do figure this out, then it might be worth adding to the How To's.
I honestly thought this was an easy one to figure out. CF has the choice of a Multi-Select element.
Therefore, it's only safe to assume that one should be able to populate one on a form for editing purposes.
But maybe I'm the first to try to attempt such a feat.
I guess the good news is, once we do figure this out, then it might be worth adding to the How To's.
Hi Mike,
I usually duck out when Max relies to a thread as it doesn't help to have two of us chipping in but this has been dragging on for a while now. By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.
Bob
I usually duck out when Max relies to a thread as it doesn't help to have two of us chipping in but this has been dragging on for a while now. By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.
Bob
Hi Mike,
I've spent a long time on this today with many lines of debug code and have eventually solved it :-(
The problem is that the data array is saved in the database table separated with ', ' and that space remains attached to the value when it is restored. You can see the effect in this image:
[attachment=1]16-08-2013 15-40-40.png[/attachment]
Removing the space in the database fixes the problem; you could also use a little PHP in a Custom Code action to clean the data. This worked OK:
With one or other of these fixes the multi-values show correctly:
[attachment=0]16-08-2013 16-14-59.png[/attachment]
Bob
I've spent a long time on this today with many lines of debug code and have eventually solved it :-(
The problem is that the data array is saved in the database table separated with ', ' and that space remains attached to the value when it is restored. You can see the effect in this image:
[attachment=1]16-08-2013 15-40-40.png[/attachment]
Removing the space in the database fixes the problem; you could also use a little PHP in a Custom Code action to clean the data. This worked OK:
<?php
if ( isset($form->data['available_parts']) && is_array($form->data['available_parts']) ) {
foreach ( $form->data['available_parts'] as $k => $v ) {
$form->data['available_parts'][$k] = trim($v);
}
}
?>
With one or other of these fixes the multi-values show correctly:
[attachment=0]16-08-2013 16-14-59.png[/attachment]
Bob
Beautiful Bob! Thanks so much. I guess it was something that was simple but not easy to debug.
I just have one question, is there a way to print out the separators? Maybe modifying ChronoConnectivity?
I think I was using the ", " because all of the words in the array were running together when I went to display them.
All is working correctly now (spaces between the words and multiple selects in the form). But it would just look better with commas separating them. I tried the "Arrays Value Merger" and that didn't work.
If you don't know how to debug this right away, I can live with how it is for now.
You are a gem. If I am ever in Brittany, I'll buy you a beer๐
Thanks again,
Mike
I just have one question, is there a way to print out the separators? Maybe modifying ChronoConnectivity?
I think I was using the ", " because all of the words in the array were running together when I went to display them.
All is working correctly now (spaces between the words and multiple selects in the form). But it would just look better with commas separating them. I tried the "Arrays Value Merger" and that didn't work.
If you don't know how to debug this right away, I can live with how it is for now.
You are a gem. If I am ever in Brittany, I'll buy you a beer๐
Thanks again,
Mike
Hi Mike,
Where do you need to print out these options? In ChronoConnectivity there is an Array Values Merger setting on the Frontend List Settings | General tab that should set this for you.
Bob
Where do you need to print out these options? In ChronoConnectivity there is an Array Values Merger setting on the Frontend List Settings | General tab that should set this for you.
Bob
Bob,
As I mentioned, I did try that and it didn't work.
I gave you the link to the front end in my PM. You can log-in with the credentials that I gave you to Joomla.
Again, not a big deal if we can't figure it out, but it would look a lot better to have them separated better.
Thanks,
Mike
As I mentioned, I did try that and it didn't work.
I gave you the link to the front end in my PM. You can log-in with the credentials that I gave you to Joomla.
Again, not a big deal if we can't figure it out, but it would look a lot better to have them separated better.
Thanks,
Mike
This topic is locked and no more replies can be posted.