Open sitecorepm opened 1 year ago
Hey @blipson89 , any chance this can make it into the next release?
@sitecorepm
I encountered a similar issue with this one in my environment, which occurred in the Select Media dialog box. Regardless of the search filter I chose, it always returned "No items found".
I discovered this issue while searching for a solution.
The fix you proposed splendidly resolved the phenomenon that was happening in my environment.
My environment: Sitecore 10.3.1 Synthesis 9.1.6
From Japan with gratitude, ARIGATOU
Happy Friday!
Do you want to request a feature or report a bug? BUG
What is the current behavior? After a Synthesis Solr search using GetSynthesisQueryable is run, forms no longer show up in the Sitecore Forms editor listing.![image](https://github.com/blipson89/Synthesis/assets/1508064/b76f5bf3-14b2-435e-b68e-dceac934cbec)
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior? Forms should not disappear
Please mention your Sitecore version and Synthesis version. Sitecore 10.2 (yes I know (now) it's not technically supported... but I like living on the edge) Synthesis 9.1.6
Detailed Description with potential fix The credit for this sleuthing goes to Michael Doroshenko from Sitecore Support. In short, he found that after a Synthesis search was run the normal Sitecore SOLR search that runs to retrieve the list of forms was incorrectly setting the suffix on the is_template_b field to is_template_t. Then he dug into why... here's his last response:
" I was running some additional tests and I reproduced the issue when I added Synthesis assemblies/configs and then executed a query using "GetSynthesisQueryable" call. When such a query is executed, the default "fieldNameTranslator" property of sitecore_master_index is replaced by Synthesis.Solr.ContentSearch.SynthesisSolrFieldNameTranslator. The Synthesis.Solr.ContentSearch.SynthesisSolrFieldNameTranslator is not able to resolve the related field type correctly leading to this issue. [...] I think that the issue is related to the following class: https://github.com/blipson89/Synthesis/blob/706ce71741bc9c826ff99993a4f139276f787d0a/Source/Synthesis.Solr/ContentSearch/SynthesisSolrFieldNameTranslator.cs
For some reason, the custom code directly uses Solr schema instead of working with the default Sitecore logic. This method assumes that if a field is not present in the loaded Solr schema, it should be treated as a text field:
As far as I understand, the default Sitecore field mapping logic is just ignored and "is_template" field is loaded as text instead of boolean.
The default Sitecore implementation of that method just calls API to resolve the field type based on the configuration:
The module source code is on GitHub, so you can modify the related code and build an updated assembly. I believe just calling "return base.GetIndexFieldName(fieldName, (CultureInfo)null);" instead of "return AppendSolrText(fieldName);" is enough to fix this issue. Please note that it's not clear why the module calls "AppendSolrText(fieldName)", so it might impact the custom module logic. "
I tried the recommended solution and that DID in fact fix the issue. I can create a PR for it if you want.
Thanks!
Paul