Excuse my english...

When i try to create a new metadata tags field named 'category' in the settings page, it doesn't work. I submit the form and i don't have anything else in the setting page.
But i have a field named 'new' in the form when i create a new audio node.
the 'new' metadata tags doesn't appear in the setting page and i can't delete it...

Comments

roger6106’s picture

I am also unable to add new categories.

deviantintegral’s picture

Title: Impossible to add a new metada tag » Impossible to add a new metadata tag
Version: 6.x-1.0-unstable3 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new885 bytes

I encountered this as well. It looks to be caused by the fact that the system settings form is used, without using the existing submit and theme function. You can't just add the submit function, as it will later in the process overwrite the variable with the invalid data.

I also had to array_filter() rows as it was creating an array of empty arrays which caused an extra "ghost" table to appear.

This patch solves the issue for me.

roger6106’s picture

This patch allows me to add and remove tags, although it gives me an error when submitted:

warning: Invalid argument supplied for foreach() in [...]/sites/all/modules/audio/audio.admin.inc on line 149.

roger6106’s picture

StatusFileSize
new1.48 KB

I did some more testing with this patch, and I realized that deleting metadata wasn't working. I updated the patch submitted by deviantintegral to allow for the deleting of metadata. This also gets rid of the error I was experiencing.

wedge’s picture

StatusFileSize
new1.29 KB

I had the same problem but forgot to check for existing solutions before trying to fix it myself.

Hence, my fix is almost the same as yours. :)

drewish’s picture

boy i love it when i half port something... at least there was a TODO.

wedge's patch looks pretty good but i wonder if we need to combine in the last bit of roger6106's that hits the theme function? it seems like wedge's might handle it all. i don't have time to test it right now but i'm going to try to clean up the audio module queue later this week.

deviantintegral’s picture

Status: Needs review » Needs work

@drewish, I'm pretty sure the patch in #5 won't display the table properly. I'm not sure why it should call theme_system_settings_form() if it's not a system settings form. Some hybrid of #4 and #5 sounds good to me.

drewish’s picture

Status: Needs work » Fixed
StatusFileSize
new4.92 KB

committed the attached. it also adds drag and drop ordering to the table.

deviantintegral’s picture

Tabledrag - sweet! Thanks for getting this in.

drewish’s picture

deviantintegral, of course, sorry it's taken so long. i really appreciate all your patches it makes it a lot easier to get started on these bugs.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.