The Item Reource extraction event handler is only working after
I have run the code twice (even though items are restored the first time the
code is run).
For example, if I have all dictionary items in a revision. If I rename content of 1 dictionary item, and
delete 1 item. Then I extract with this code:
var engine = newRevisionExtraction(packageToExtract); engine.ExtractingItem += newEventHandler<ItemEventArgs>(ex_ExtractingItem); engine.ExtractingItemResources += newEventHandler<ItemEventArgs>(engine_ExtractingItemResources);
hmm, cant really say why, maybe courier doesnt recognise you made a change to overwrite in the case of the renaming of the item.
Try Hooking into the Extracted event instead, this will give you the item and its itemstatus back, which provides abit more debugging info, so we can atleast see if they got through the extraction phase succesfully
I tried hooking in to the Extracted Item and Extracted Item Resource events. On both the first and second run the output is the same. It shows all status as “Extracted”, but the Item Values are not actually updated until the second run (although any deleted content is restored on the first run).
Problem with Courier Extraction Manager
I’m having trouble with Courier Extraction Manager. I’m using something similar to the sample ExtractionConsole code here: https://github.com/umbraco/Courier/blob/master/Samples/Umbraco.Courier.ExtractionConsole/Program.cs
The Item Reource extraction event handler is only working after I have run the code twice (even though items are restored the first time the code is run).
For example, if I have all dictionary items in a revision. If I rename content of 1 dictionary item, and delete 1 item. Then I extract with this code:
And I get this output written to console:
Extracting Item Resources: English (United Kingdom) Extracting Item Resources: HolidayTypes.Beach Extracting Item Resources: HolidayTypes.CityBreak Extracting Item Resources: HolidayTypes Extracting Item Resources: HolidayTypes.Coach Extracting Item Resources: HolidayTypes.Events Extracting Item Resources: HolidayTypes.Jersey Extracting Item Resources: HolidayTypes.Cruises Extracting Item: English (United Kingdom) Extracting Item: HolidayTypes Extracting Item: HolidayTypes.Beach Extracting Item: HolidayTypes.CityBreak Extracting Item: HolidayTypes.Coach Extracting Item: HolidayTypes.Events Extracting Item: HolidayTypes.Jersey Extracting Item: HolidayTypes.Cruises ====================================== DONE! ======================================
It looks like it should have been successful. The deleted item is restored, but renamed content is not restored.
If I run the code again, the output from the console is exactly the same. But this time the renamed content is successfully restored.
I have these values set to ‘Always’
It happens like this each time. Any ideas why this is only working on second run?
hmm, cant really say why, maybe courier doesnt recognise you made a change to overwrite in the case of the renaming of the item.
Try Hooking into the Extracted event instead, this will give you the item and its itemstatus back, which provides abit more debugging info, so we can atleast see if they got through the extraction phase succesfully
One other thing, try checking the database for the actual values, and not just the tree, as there might be some caching that is messing with this.
Hi Per,
Thanks for your replies.
I tried hooking in to the Extracted Item and Extracted Item Resource events. On both the first and second run the output is the same. It shows all status as “Extracted”, but the Item Values are not actually updated until the second run (although any deleted content is restored on the first run).
Here’s the console output:
Extracted Item: English (United Kingdom)
Extracted Item Status: Extracted
Extracted Item: HolidayTypes
Extracted Item Status: Extracted
Extracted Item: HolidayTypes.Cruises
Extracted Item Status: Extracted
Extracted Item: HolidayTypes.Beach
Extracted Item Status: Extracted
Extracted Item: HolidayTypes.Events
Extracted Item Status: Extracted
Extracted Item: HolidayTypes.CityBreak
Extracted Item Status: Extracted
Extracted Item: HolidayTypes.Jersey
Extracted Item Status: Extracted
Extracted Item: HolidayTypes.Coach
Extracted Item Status: Extracted
Extraction complete
======================================
DONE!
======================================
I checked the database, and the values are not updated on the first run.
Currently I’ve set it to run twice to get around this, but it’s a bit of an annoying hack!
Any other ideas?
is working on a reply...