Closed (fixed)
Project:
Scheduler
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Jun 2024 at 12:03 UTC
Updated:
27 Aug 2024 at 12:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
jonathan1055 commentedUsing a 10.3.x site and the config_update module the differences report showed that for the Node and Media views, the
user_page::display_options::arguments::uid::plugin_idhas been changed from numeric to entity_target_id and there is a new keytarget_entity_type_idwith a value of userThe tests now run OK at 10.3 (both locally and in pipelines), but every test fails at 10.2 with
Comment #4
dwwQuite confused. Nothing was backported to 10.2.X. I don’t see how this could possibly be causing any test failures. But it’s late and I’m not of my right mind, so I’ll try to look again when I’m sober and have had some sleep. 😂
Comment #5
dwwOh, I misread. Yeah, if you’re running against 10.3.x, you need to update any default views to use the new handler. Maybe we need another CR to clarify?
Comment #6
jonathan1055 commentedThanks for the reply. I have updated the views .yml files so that the tests run and pass at 10.3 without the deprecation. But it has caused the tests to fail at 10.2
That might be the problem. I want the module to be compatible with 10.2 and 10.3. Is that possible?
Comment #7
catchThat exception should only be thrown when
strictConfigSchemais set to TRUE. Could you set it to FALSE, and then set it to TRUE again when 10.2 support is dropped (i.e. in about six months). Or... possibly conditionally set it based on Drupal core version?Comment #8
jonathan1055 commentedThank you @catch, yes setting
strictConfigSchemato FALSE has solved it, running locally the tests pass at 10.2 now. I will do a conditional to set it based on core version, as I presume we want it TRUE for all versions 10.3+Comment #9
dwwWhen I get a moment when I’m not on my phone, I’ll try to update the CR for some additional clarity. But a few points here now that I’ve slept:
numericit’ll keep “working” as well as it always has.So my recommendation for right now is to leave your views using
numeric, tell GitLab CI to ignore the resulting depreciation notices until you’re ready to ship a release that requires at least 10.3.x, then you can convert your shipped views and reconfigure your pipelines to fail on depreciations (if that’s what you actually want). 😅Thanks / apologies,
-Derek
Comment #10
dwwMentioned at the core issue, but maybe we want a quick follow up to silence this deprecation in 10.3.x so it only starts getting hit in 10.4.x when 10.2.x is no longer supported?
Comment #12
jonathan1055 commentedThanks dww for the info in #9. Sounds like I should remove the
strictConfigSchema=FALSEand also revert the change to the views.I understand when you say that the new plugins were not backported to 10.2, but I am not seeing any error, and the views appear to work. What problem would I see? I'd like to expand the test coverage on the views we provide so that modifiying the view in this way would fail a phpunit test. But I can't see anything wrong in the UI, when using the view in 10.2 with the changed plugin.
Comment #13
jonathan1055 commentedAdding the core issue that introduced this change.
Comment #16
vishalkhode commented@jonathan1055: The CI is green now. Please review the changes. To address the issue, I created a test module named
scheduler_config_legacy_test. This module updates the views configuration at runtime and reverts it to the previous value before saving, preventing schema exception errors for Previous Minor/Major Drupal Core versions. The reason for creating a separate module is to ensure it can be installed and enabled only for Previous Minor/Major Drupal core versions, thereby avoiding invoking configuration save events for the Current and Next Major Drupal core versions. Thanks.Comment #17
chandu7929 commentedI have verified the views configuration changes on 10.2 and I don't see any functional impact, I think we should proceed further by adding
$strictConfigSchema = FALSE;in test, considering the comment from other issueComment #18
dwwGot really slammed with many things. Finally circling back to this. Upon some of my testing, I was greatly confused as to why there weren't fatal errors if you updated your views config to point to plugins that don't exist. The answer is there's a bug in core #3458099: Views handler loading should respect configuration. 😂 Views doesn't actually honor the plugin IDs in the exported config, and instead uses the whole views data API to determine exactly what plugin to use for every specific field on every specific table.
So, due to #3458099, I was totally wrong above. 😅 Until 3458099 is committed, it's actually completely harmless to "fix" your config and backport it, even to branches where the new plugin doesn't exist. So nearly all the complications in this MR are unnecessary and all you really have to do for now is update your views config. Nothing will actually use that config to determine what plugin is used until 3458099 is fixed. All that actually matters is the views data API implementations in each branch, and those will always find the correct plugin based on what exists.
Comment #19
jonathan1055 commentedThank you dww! I was not happy with all the work-around in this MR, and I was going to see if we could silence the deprecation error until later. Your observed behavior at 10.2 matches mine in that the views still appear to work. However, I did report that the tests fail at 10.2, so we may still need to set
strictConfigSchema = FALSEconditionally when running versions prior to 10.3Comment #21
jonathan1055 commentedUsing the usual conditional version_compare to set
$strictConfigSchema = FALSEin the test setUp() functions is too late to prevent the schema validation. Therefore we can patch the test files to set this value as if it was defined from the start.https://git.drupalcode.org/project/scheduler/-/pipelines/240327 shows this working for Previous Major functional test (not inlcuded Kernel and Javascript in the patch yet).
Comment #22
jonathan1055 commentedThis is ready for review. All phpunit tests now pass an 'Next Major' but I have used Gitlab Templates MR240 from #3414505: Allow all sub-modules to be compatible with next_major to help in testing.
Comment #26
jonathan1055 commentedFixed using my alternative (simpler) method. But also adding credit to @vishalkhode and @dww for their contribiutions on this issue. Thank you.
Comment #29
jonathan1055 commentedBackported to 8.x-1.x