Avatar of Modifier1000
Flag for United States of America asked on

Switching widgets removed data from first widget

Hey all,

I have a Drupal 7 application with custom content types that had some select lists using Entity References.  Our editors created new content with the custom type and selected multiple entries from the select list (ctrl+click).

Well, I decided to instead use the Auto-complete, because it was faster for the editors to use.  Now when the editors visit previously developed content, the selections they used before the widget change are no longer linked to the content.

I did not remove/delete the select list widget, I just merely changed it to Auto-complete.

Any ideas on what happened and if I'll be able to get those other linked items back?


Avatar of undefined
Last Comment

8/22/2022 - Mon
Hagay Mandel

Few questions not as potential solution but just for a  better understanding:
Are the widgets custom ones as the content type. If so, please let us see the code.
Does the auto complete work with new content?
If switched back to select list, do the old content come back?
Have you checked your database for the existing data?

Not a custom widget.
Yes, Autocomplete does work with new content.
Switching does not bring back old data.
Have not checked DB, but will when I get back into town.

I cannot repeat the issue, but 3 editors have complained that their data is no longer available once I switched to the Drupal Autocomplete from the Drupal Select List.
Hagay Mandel

Switching does not bring back old data.

My guess is that there was no data there before the switch!
You can easily test it:
1. Add new content, and make sure you have data in the those entity reference fields.
2. Switch widgets, back and forth, and see for yourself whether the data remains or vanishes.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

Yeah, I had already tried the 'test' and all worked well.

I also think that the data was not in there, but I have 3 very upset editors who are sure there was data before the switch.

If it were one, I would say it was their fault, but being 3 is raising a red flag with me.  I cannot find any place on the internet that has the same issues either.  I really want to say it's 'User Error', but I just wanted to make sure I am not leaving any stone unturned before I conclude they were at fault.
Hagay Mandel

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

~1000 nodes.