Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Thank you for this module! Looking forward to using it.
Just installed on a site in development and when I save, I'm receiving warnings like:
in_array() expects parameter 2 to be array, string given in textcleaner_clean_input() (line 65..
This is on a custom taxonomy term field (long text). I can try and dig deeper when I get some breathing room, but I'm hoping it's an obvious fix.
..jon
Comments
Comment #1
kevinquillen CreditAttribution: kevinquillen commentedHm. I think it may be because you have not selected which fields yet to act on in the TextCleaner config?
Comment #2
kevinquillen CreditAttribution: kevinquillen commentedYou're right though, I forgot to set a default for the variable during install or when checking, instead it sets a ''.
I should set at least a default of long text so it works prior to changing config.
Comment #3
JonMcL CreditAttribution: JonMcL commentedDoh!
My bad for not checking for a config screen. I just assumed it worked on all text fields. Maybe a message with link after module activation would be a good idea? Or a 'configuration' link in the module list.
Unfortunately, once I did enable the "long text and summary" fields, I hit some more errors. If you want, I'll try and submit new issues, but a quick summary from what I saw:
For that second one, I'm guessing this is when it reaches a field that doesn't have a 'value' component. So it might be a good idea to check for a 'value' element before processing on it since operator error will probably lead to fields being enabled that won't work. But then also check your configuration form save to make sure the variable is setup the way you're expect. Here's what mine looks like:
I would contribute with some patches, but I have to stay focused on my project right now :(
..jon
Comment #4
kevinquillen CreditAttribution: kevinquillen commentedI see that, I used drupal_map_assoc() from the documentation to map default values to a multicheckbox form field. The result winds up saving like that, unless there is another way to do it.
Comment #5
kevinquillen CreditAttribution: kevinquillen commentedSorry for the delay, I began poking away at these issues last night.
The drupal_map_assoc is bugging me. I would not like to store the data the way it is, but I also want to ensure options are checked off on the settings page. Is there a better way to do it without mucking up the stored data?