Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3388012: Deprecation reports to be compatible with D10 #3533

Merged

Conversation

vcsvinicius
Copy link
Contributor

@vcsvinicius vcsvinicius commented Sep 18, 2023

Problem

The Upgrade Status module, gave to us a report with all issues to be fixed to make the Open Social compatible with Drupal 10.

Solution

Social deprecation-function:
The major version 12 will be used to upgrade the Drupal to version 10, so all deprecation function from Social should be changed to be removed at major version 13.

Drupal deprecation-function:
Update all deprecated function from Drupal to the new function.

Sub-modules core version:
Update the drupal-core-version at info files from sub-modules.

Issue tracker

Theme issue tracker

N/A

How to test

  • Smoke test in the system

Definition of done

Before merge

  • Code/peer review is completed
  • All commit messages are clear and clean. If applicable a rebase was performed
  • All automated tests are green
  • Functional/manual tests of the acceptance criteria are approved
  • All acceptance criteria were met
  • New features or changes to existing features are covered by tests, either unit (preferably) or behat
  • Update path is tested. New hook_updates should respect update order, right naming convention and consider hook_post_update code
  • Module can be safely uninstalled. Update/implement hook_uninstall and make sure that removed configuration or dependencies are removed/uninstalled
  • This pull request has all required labels (team/type/priority)
  • This pull request has a milestone
  • This pull request has an assignee (if applicable)
  • Any front end changes are tested on all major browsers
  • New UI elements, or changes on UI elements are approved by the design team
  • New features, or feature changes are approved by the product owner

After merge

  • Code is tested on all branches that it has been cherry-picked
  • Update hook number might need adjustment, make sure they have the correct order
  • The Drupal.org ticket(s) are updated according to this pull request status

Screenshots

N/A

Release notes

Open Social version 12 will only contain a Drupal 10 upgrade as its scope; this is why we are changing the deprecation of this method from version 12 to 13.

Files with deprecated message update:

  • modules/social_features/social_event/src/Service/SocialEventEnrollService.php
  • modules/social_features/social_event/src/Service/SocialEventEnrollServiceInterface.php
  • modules/social_features/social_event/social_event.services.yml
  • modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php
  • modules/social_features/social_album/social_album.install
  • modules/social_features/social_content_block/social_content_block.api.php
  • modules/social_features/social_core/social_core.api.php
  • modules/social_features/social_core/src/Controller/SocialCoreController.php
  • modules/social_features/social_core/src/Routing/RouteSubscriber.php
  • modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.api.php
  • modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.module
  • modules/social_features/social_group/modules/social_group_flexible_group/src/Plugin/views/filter/FlexibleGroupNodeAccess.php
  • modules/social_features/social_group/modules/social_group_request/social_group_request.api.php
  • modules/social_features/social_group/social_group.module
  • modules/social_features/social_group/src/JoinManager.php
  • modules/social_features/social_tagging/social_tagging.module

Change Record

N/A

Translations

N/A

@vcsvinicius vcsvinicius added type: update status: needs review This pull request is waiting for a requested review prio: high team: guardians labels Sep 18, 2023
@vcsvinicius vcsvinicius added this to the 12.0.0-alpha2 milestone Sep 18, 2023
@mergeable
Copy link

mergeable bot commented Sep 18, 2023

Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊

@robertragas
Copy link
Contributor

Codewise it looks good, but guess we need to functionally test out all the new access checks to verify it still works as intended.

Phpstan failing with the baseline, that we still need to adjust.

@@ -160,14 +160,19 @@ function _social_follow_tag_update_existing_messages(array &$sandbox): void {
// Get all message IDs than should be updated.
$query = $message_storage->getQuery()
->condition('template', 'create_node_following_tag_stream');
$mids = $query->execute();
$mids = $query
->accessCheck(TRUE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can put this accessCheck to false, as when run it will be anonymous and only takes what the anonymous user can view. In this case we want to update this message template regardless to if the current user has access to it.

$sandbox['total'] = $query->count()->execute();
$sandbox['total'] = $query
->count()
->accessCheck(TRUE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@robertragas
Copy link
Contributor

When functionally testing it out it also noticed (not caused by this code) the whole social_follow_tag update hook code is not really working. It tries to update a message template "create_node_following_tag_stream" in a sandbox environment, while it's only 1 message template that it updates, so no sandbox needed. Also this message template does not exist on new installs as it's only added in an update hook.

I will create a seperate issue for that.

@robertragas
Copy link
Contributor

Btw @vcsvinicius don't forget to fill in the "release notes" part and maybe also the "change records" to tell them some of the deprecations will be removed in 13.0 and not 12.0

vcsvinicius and others added 8 commits September 20, 2023 11:35
Open Social version 12 will only contain a Drupal 10 upgrade as its scope; this is why we are changing the deprecation of this method from version 12 to 13.
Access checking must be explicitly specified on content entity queries
see: https://www.drupal.org/node/3201242
Open Social version 12 will only contain a Drupal 10 upgrade as its scope; this is why we are changing the deprecation of this method from version 12 to 13.
Open Social version 12 will only contain a Drupal 10 upgrade as its scope; this is why we are changing the deprecation of this method from version 12 to 13.
Hook install are user agnostic, hence we don’t need to add accessCheck(true)
@vcsvinicius vcsvinicius force-pushed the issue/3388012-Deprecation-reports-to-be-compatible-with-d10 branch from 357025d to bf8cf7e Compare September 20, 2023 14:58
@vcsvinicius vcsvinicius removed the status: needs review This pull request is waiting for a requested review label Sep 20, 2023
@robertragas robertragas self-requested a review September 21, 2023 11:49
@robertragas robertragas merged commit f8a7ee4 into main Sep 21, 2023
188 of 190 checks passed
@robertragas robertragas deleted the issue/3388012-Deprecation-reports-to-be-compatible-with-d10 branch September 21, 2023 11:51
@robertragas robertragas added the backport: verified This pull request has been back ported to an older minor version label Sep 21, 2023
@robertragas
Copy link
Contributor

Approved, merged and cherry-picked to 12.0.x

@Kingdutch Kingdutch added type: dependencies Updating a dependency file and removed type: update labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: verified This pull request has been back ported to an older minor version prio: high team: guardians type: dependencies Updating a dependency file
Development

Successfully merging this pull request may close these issues.

4 participants