0

I created an app with the sxc module. Now I have like 500 empty rows which I want to delete.

I searched for them in the database to delete them all but I cannot seem to find them and I think it is a waste of time to delete them all 1 by 1.

It's data in "Manage content / data" table.

Let me know please.

I have another question: If I edit an item. The title of the module gets changed with the first items 'name' field. How to avoid that? Is it an bug?

Thanks in advance.

Chris Hammond
  • 8,873
  • 1
  • 26
  • 34
  • Hello, the data in 2sxc is not stored like typical relational data that you might be used to. So I don't recomend trying to dig in the table for bulk updates. I would suggest using their data import and export feature here:https://2sxc.org/en/Learn/Content-Export-and-Import – J King Jan 23 '17 at 14:47
  • the module title is not a bug. It is usually best to use a title-less module if you need full control of your design for 2sxc content. – J King Jan 23 '17 at 14:48

1 Answers1

1

Basically JKings answer is correct - this kind of bulk-operation can easily be done using export/import, because on re-import you can tell 2sxc to delete all items not found in the import. This ensures that 2sxc can take care of data integrity etc. Instructions https://2sxc.org/en/Learn/Content-Export-and-Import

So the correct steps are:

  1. export the list
  2. open in notepad, xml editor (or use excel, as shown in the link)
  3. Remove all those you don't want
  4. Re-import, but choose the option to "Remove all entities not found in import"

You're set :)

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21
  • Hi, thanks for your reply. I have one question left: If I export, remove all I don't want and import new file, are all these items getting different ID's then before? I have a template using those ID's. – Danny Brouwer Jan 25 '17 at 16:12
  • Each item keeps the ID and the GUID, but just to be safe you should do a dry-run on another table with some test entries. – iJungleBoy Jan 26 '17 at 16:40
  • Thanks for you answer. It is working indeed. I just want you to know that the exported xml file has an incorrect ending. It ends with – Danny Brouwer Jan 31 '17 at 10:26
  • @DannyBrouwer are you using a current version of 2sxc? this used to be a bug but should be fixed – iJungleBoy Feb 01 '17 at 08:49