We have moved to GitHub Issues
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.
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
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.
Great job Shannon :), merging.
Backwards Compatible: True
Affected versions: 7.7.3, 7.6.11
Due in version: 7.7.8
Sprint: Sprint 74
Story Points: 1