U4-10588 - Indexed member data is missing fields

Created by Claus Jensen 24 Oct 2017, 22:06:26 Updated by Robert Copilau 12 Dec 2017, 12:40:26

Subtask of: U4-9609

When saving a member initially - it will get indexed with about 18 fields (see screenshot). When this member is resaved (no difference if you do it instantly after the first save or if you reload the page and resave) it is now missing 4 of those previously indexed fields.

I don't know if the error is that those fields are being indexed initially - or if the error is that they are not indexed afterwards.

Bonus info: Thinking that it may not have used the settings from the config file for the initial save - I've tried removing the IndexAttributeFields to see the results of this. This however causes all the default fields to be saved in the index -- so not the same result as the initial save (which means that this wasn't the problem)

Confirmed in 7.6.11 and 7.7.3

2 Attachments

Comments

Shannon Deminick 12 Dec 2017, 10:31:30

The problem was that when Saving a member, the MemberBinder is the thing that looks up the IMember but since the underlying membership providers are responsible for updating the built in member data (i.e. IsApproved, etc...) these properties were actually removed from the IMember object and would only be remapped if the membership provider made any changes to these. This meant that the IMember was serialized without these properties which was then passed to Examine. When a member is created however, the process is slightly different because the membership provider always fills in these values and persists the member.

The fix is to remove the logic that was removing these properties when looking up the IMember object. This doesn't have any negative side affects since if those values need to be updated by the membership provider, they still will and they will be re-mapped to the IMember object anyways. This then allows these properties to be serialized which means they will get into Examine.

Another issues discovered was that the LazyIndexCriteria class exists to avoid any SQL lookups on startup, however the lazy value was being executed on startup anyways which meant a SQL lookup during startup. This was due to the MemberIndexer trying to add an explicit field to the index criteria. The fix is to pass this explicit field to the LazyIndexCriteria so that it will add it when the lookup is required so that this lazy value is not activated during startup.

PR https://github.com/umbraco/Umbraco-CMS/pull/2348

For testing:

  • Create a member and go look up its data in the Examine manager, you'll see all of the data there
  • Re-save this member and view the data in Examine Manager and all the data will still be t here
  • Update some of the built in properties like approved, comments, etc... and note that they will be persisted properly still and that these new values also get into the index (as seen in the Examine Manager)


Robert Copilau 12 Dec 2017, 12:40:19

Testing results:

  • All member data is present upon member creation
  • All member data is present upon member re-save
  • All modified properties persists and got indexed

Luke has been used to check all the above.

Great job Shannon :), merging.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.7.3, 7.6.11

Due in version: 7.7.8

Sprint: Sprint 74

Story Points: 1

Cycle: 5