OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Query Field Blank After Upgrading Orchard from Version 1.8.3 to 2.0.0

Open vikasmahant69 opened this issue 1 year ago • 12 comments

Describe the bug

After upgrading Orchard CMS from version 1.8.3 to 2.0.0, the query field appears blank for all existing queries. This issue affects queries created using Elastic, Lucene, or SQL in the admin section, as they are no longer visible in the query field post-upgrade.

Newly created queries function correctly, but if you create a deployment plan from these new queries and import it into the same version, the query field still appears blank

Orchard Core version

2.0.0

To Reproduce

Create a query (e.g., Elastic, Lucene, or SQL) in Orchard version 1.8.3 from the admin section. Upgrade the source code to Orchard version 2.0.0. Navigate to the admin section and open the same query created in version 1.8.3. Observe that the query field is blank or empty.

Expected behavior

All existing queries created in version 1.8.3 should be visible and editable in the admin section after upgrading to version 2.0.0.

Logs and screenshots

error screenshot OCQueryError

vikasmahant69 avatar Sep 23 '24 14:09 vikasmahant69

Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. On what happens next, see the docs.

If you like Orchard Core, please star our repo and join our community channels.

github-actions[bot] avatar Sep 23 '24 14:09 github-actions[bot]

Do you have anything in the logs? @MikeAlhayek could you please chime in?

Piedone avatar Sep 23 '24 20:09 Piedone

@vikasmahant69 can you please check the data migration records to see if the following migrations ran?

For SQL queries https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Queries/Sql/Migrations/SqlQueryMigrations.cs

For Elasticsearch queries https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Search.Elasticsearch/Migrations/ElasticsearchQueryMigrations.cs

For Lucene queries https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Search.Lucene/Migrations/LuceneQueryMigrations.cs

If not, please check your log files for errors.

Which database type are you using?

it is possible that this like throw an exception during migration https://github.com/OrchardCMS/OrchardCore/blob/80ff8b867a286544ab135c0a1301034bf5146303/src/OrchardCore/OrchardCore.Queries.Core/QueriesDocumentMigrationHelper.cs#L56

MikeAlhayek avatar Sep 23 '24 23:09 MikeAlhayek

@MikeAlhayek I checked the data migration records and see the following migrations ran

{"Id":21,"DataMigrations":[{"DataMigrationClass":"OrchardCore.Liquid.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.ContentManagement.Records.Migrations","Version":6},{"DataMigrationClass":"OrchardCore.Contents.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Title.Migrations","Version":2},{"DataMigrationClass":"OrchardCore.Html.Migrations","Version":5},{"DataMigrationClass":"OrchardCore.Alias.Migrations","Version":4},{"DataMigrationClass":"OrchardCore.Autoroute.Migrations","Version":5},{"DataMigrationClass":"OrchardCore.ContentFields.Migrations","Version":2},{"DataMigrationClass":"OrchardCore.Users.Migrations","Version":13},{"DataMigrationClass":"OrchardCore.ContentPreview.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Deployment.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Widgets.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Flows.Migrations","Version":3},{"DataMigrationClass":"OrchardCore.Forms.Migrations","Version":4},{"DataMigrationClass":"OrchardCore.Media.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.ReCaptcha.Forms.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Workflows.Migrations","Version":3},{"DataMigrationClass":"OrchardCore.Contents.AuditTrail.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.AdminDashboard.Migrations","Version":3},{"DataMigrationClass":"OrchardCore.AuditTrail.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.ContentFields.Indexing.SQL.Migrations","Version":5},{"DataMigrationClass":"OrchardCore.ContentFields.Indexing.SQL.UserPickerMigrations","Version":2},{"DataMigrationClass":"OrchardCore.Sitemaps.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget.ExportContentToDeploymentTargetMigrations","Version":1},{"DataMigrationClass":"OrchardCore.Indexing.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Layers.Migrations","Version":3},{"DataMigrationClass":"OrchardCore.Lists.Migrations","Version":4},{"DataMigrationClass":"OrchardCore.Markdown.Migrations","Version":4},{"DataMigrationClass":"OrchardCore.Menu.Migrations","Version":4},{"DataMigrationClass":"OrchardCore.PublishLater.Migrations","Version":3},{"DataMigrationClass":"OrchardCore.Search.Migrations.SearchMigrations","Version":1},{"DataMigrationClass":"OrchardCore.Search.Lucene.Migrations","Version":1},{"DataMigrationClass":"OrchardCore.Seo.Migrations","Version":2},{"DataMigrationClass":"OrchardCore.Taxonomies.Migrations","Version":5},{"DataMigrationClass":"OrchardCore.Email.Migrations.EmailMigrations","Version":1},{"DataMigrationClass":"OrchardCore.Queries.Sql.Migrations.SqlQueryMigrations","Version":1},{"DataMigrationClass":"OrchardCore.Queries.Sql.Migrations.ElasticsearchQueryMigrations","Version":1},{"DataMigrationClass":"OrchardCore.Queries.Sql.Migrations.LuceneQueryMigrations","Version":1}]}}

I'm using MSSQL 2022

vikasmahant69 avatar Sep 24 '24 09:09 vikasmahant69

It looks like the migrations ran. Any errors in the logs?

MikeAlhayek avatar Sep 24 '24 15:09 MikeAlhayek

No errors, queries simply disappear when opened from the query section from the admin

vikasmahant69 avatar Sep 26 '24 15:09 vikasmahant69

I also encountered a new issue in Graphql " "message": "Error trying to resolve field 'termContentItems'."," it was working working with 1.8.3

here is my query

query MyQuery { charities { contentItemId name sector { termContentItems { display text } } } }

vikasmahant69 avatar Sep 26 '24 15:09 vikasmahant69

Hi @vikasmahant69 - I tried to reproduce this error but haven't been able to do it yet. Here are the steps i used:

  1. Check out v1.8.3 of the source code
  2. Renamed existing App_Data folder (to ensure new v1.8.3 database is created)
  3. Initialized the site using the Blog Recipe
  4. Navigated to Admin section
  5. Went to Search section, selected All Queries
  6. Added a new SQL Query (just copied/pasted from existing content query)
  7. Git check out v2.0.0 tag
  8. Rebuild, and run
  9. Navigated to the Admin->Search->All Queries->TestQuery
  10. Observe the query is still there

Did I miss a step in trying to reproduce this?

davidpuplava avatar Sep 27 '24 21:09 davidpuplava

This has occurred for both my sites with all the elastic queries, Lucene and SQL were fine, was able to reinsert them from backups but definitely an issue.

PBMikeW avatar Oct 07 '24 01:10 PBMikeW

@MikeAlhayek I have attached scenarios in videos for both 1.8.3 and then upgraded to 2.0.2

Version 1.8.3

https://github.com/user-attachments/assets/a1b087e8-52a5-447c-9725-2680082c1e2e

Version 2.0.2

https://github.com/user-attachments/assets/5197feb7-1ea7-4a87-bae0-39da7bcbe633

vikasmahant69 avatar Oct 07 '24 14:10 vikasmahant69

@vikasmahant69

I just tried creating a blog recipe using 1.8. Migrated it to main, no issues with the lost properties.

The second error is related to GraphQL which may need to be tracked separately. Please open another issues. For my none of my queries are listed on the GraphiQL explorer.

MikeAlhayek avatar Oct 12 '24 01:10 MikeAlhayek

done https://github.com/OrchardCMS/OrchardCore/issues/16883

vikasmahant69 avatar Oct 14 '24 10:10 vikasmahant69

It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply.

github-actions[bot] avatar Oct 29 '24 12:10 github-actions[bot]

Closing this issue because it didn't receive further feedback from the author for very long. If you think this is still relevant, feel free to reopen it with the requested details.

github-actions[bot] avatar Nov 05 '24 16:11 github-actions[bot]