DanDiplo / Diplo.DictionaryEditor

An Umbraco package that creates a custom section for editing Dictionary values in Umbraco. It allows easy editing of all dictionary items and also allows the dictionary to be exported and imported in CSV format.
https://www.diplo.co.uk/blog/web-development/diplo-dictionary-editor-for-umbraco/
1 stars 4 forks source link

Export doesn't include entries for a recently added language #7

Open LottePitcher opened 4 years ago

LottePitcher commented 4 years ago

Hi Dan,

A new language has recently been added to a v7 site that uses this package. When doing an export there are no entries for the new language. I'm guessing this is because the language was added to Umbraco after all the dictionary items were created.

I just wanted to check that there wasn't a work-around easier than having to re-save each individual dictionary item via the back-office (which I assume would solve the problem).

Many thanks, Lotte

DanDiplo commented 4 years ago

Hi Lotte! Hmmm, it's not a scenario I've ever tested, so I'm not actually sure what I would expect to happen. I know Umbraco does like to cache the dictionary entries, so I wonder if restarting the site (or touching web.config) might make them appear? That's the only thing I can think of.

LottePitcher commented 4 years ago

Thanks for the suggestion Dan.

I've replicated the scenario locally. If I add a new language via the back office, the new language appears as an option in the export list, but there are no entries in the created export file. If I go into a couple of dictionary items and save them, then redo the export, those couple of items are in the export file. Touching web.config has no effect.

Similarly the 'Edit Dictionary' only shows textareas for the new language for the couple that I went into and re-saved. For all the other dictionary entries, there is no textarea for the new language.

So I assume that until the dictionary item has been re-saved there isn't a DB record for the item + new language, thus it is missing from the 'Edit Dictionary' and 'Export Dictionary' functions.

I think our work-around is going to have to be to go into each individual dictionary item and re-save, then Edit/Export should work as expected.

Would it be worth me having a look to see if I could extend the 'Edit Dictionary' function so that it would display textareas for the new language, thus would be a much quicker way to get blank records added for the new language? Or perhaps you don't think it's worth it, as this is a v7 package? (although I imagine this site will be using it for a fair while longer!)

I know you have said - see issue https://github.com/DanDiplo/Diplo.DictionaryEditor/issues/3 - that you would up for porting this to v8 at some point. I haven't seen any other bulk dictionary option in v8 so unless I've missed something... are you still up for that? As if you are, and would like a collaborator, I'll put my hand up for that. Would be interested to see how all this works in v8!

DanDiplo commented 4 years ago

Hi Lotte! Thinking about it, I recall that if there's no DB entry then it won't show. I basically bypassed Umbraco's own services and went straight to the DB as this was the only way to efficiently perform a mass update (it took forever using the services). But the DB only holds records of entries, hence the issue. I was never really sure how to get around this - there might be a way, but I'm not currently sure :)

To be honest, I wasn't really going to perform any more work on this as it's a v7 package. It's the kind of feature I'd probably look at adding to v8, if I ever get around to that :) I wasn't quite sure what the demand would be in v8 and was wondering whether they'd improve the dictionary editing, but from what I've seen they haven't. So it does seem viable. I'd have to check that the database hasn't changed too drastically, as it's always really complex in Umbraco :)

I'm always happy to have people contribute. I'm feeling a bit "burned out" with Umbraco at the moment, tbh, so need some impetus to get going again!