-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
1557be4
to
f992a96
Compare
f992a96
to
e8fb662
Compare
@@ -658,6 +658,7 @@ function tide_site_taxonomy_term_delete($term) { | |||
$path_storage = \Drupal::entityTypeManager()->getStorage('path_alias'); | |||
$site_prefix = $helper->getSitePathPrefix($term); | |||
$path_ids = \Drupal::entityQuery('path_alias') | |||
->accessCheck(TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is regarding this change - https://www.drupal.org/node/3201242
@@ -690,6 +691,7 @@ function tide_site_node_update($node) { | |||
foreach ($unassigned_sites as $unassigned_site_id) { | |||
$site_prefix = $helper->getSitePathPrefix($unassigned_site_id); | |||
$path_ids = \Drupal::entityQuery('path_alias') | |||
->accessCheck(TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is regarding this change - https://www.drupal.org/node/3201242
* | ||
* @todo Extract into a service. | ||
*/ | ||
function tide_site_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) { | ||
function tide_site_field_widget_single_element_form_alter(&$element, FormStateInterface $form_state, $context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated in 9.5 and removed in d10, so had to update this to work - https://www.drupal.org/node/3180429
@@ -11,14 +11,14 @@ | |||
use Drupal\jsonapi_extras\ResourceType\ConfigurableResourceType; | |||
use Drupal\tide_site\TideSiteFields; | |||
use Drupal\tide_site\TideSiteHelper; | |||
use Symfony\Cmf\Component\Routing\RouteObjectInterface; | |||
use Drupal\Core\Routing\RouteObjectInterface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change related to this - https://www.drupal.org/node/3151009
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; | ||
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | ||
use Symfony\Component\HttpKernel\Event\ResponseEvent; | ||
use Symfony\Component\HttpKernel\Event\RequestEvent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating Symfony response and request events to new classes
* The event. | ||
* | ||
* @see \Symfony\Component\HttpKernel\HttpKernel::handleRaw() | ||
* @see \Drupal\jsonapi\Controller\RequestHandler::handle() | ||
*/ | ||
public function onRequestAddSiteFilter(GetResponseEvent $event) { | ||
public function onRequestAddSiteFilter(RequestEvent $event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating Symfony response and request events to new classes
$response = $event->getResponse(); | ||
if (!$response instanceof CacheableResponseInterface) { | ||
return; | ||
} | ||
|
||
$site_id = $event->getRequest()->query->get('site'); | ||
$site_id = $event->getRequest()->query->all()['site'] ?? []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In symfony 6, the InputBag::get(), no longer accepts arrays as default values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used to use query->get so much in Symfony work, I have no idea why the moved it towards the fetch all as an array and get the element (probably a PHP 8 thing truth be told)
@@ -246,22 +246,22 @@ public function onResponseAddSiteFilterCacheContext(FilterResponseEvent $event) | |||
* The Resource type. | |||
*/ | |||
protected function setSiteFilterToJsonApi(Request $request, array $site_filter, ConfigurableResourceType $resource_type) { | |||
$filter = $request->query->get('filter', []); | |||
$filter = $request->query->all()['filter'] ?? []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In symfony 6, the InputBag::get(), no longer accepts arrays as default values
@@ -69,7 +69,7 @@ public static function create(ContainerInterface $container, array $configuratio | |||
*/ | |||
public function getUrl(EntityInterface $entity) { | |||
/** @var \Drupal\Core\GeneratedUrl $url */ | |||
$url = parent::getUrl($entity); | |||
$url = parent::getUrl($entity)->toString(TRUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has been changed to tackle this issue - https://digital-vic.atlassian.net/browse/SRM-1167
Recently linkit module did a new release and it changed the getUrl function return from return $entity->toUrl('canonical')->toString(TRUE);
to return $entity->toUrl('canonical');
It causes issues for our custom plugin as it returns the url object instead of string. So to fix that, converting it here in the custom plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the links to issues that needing fixing! This is a great example of leading the reviewer through difficult to understand/grok changes.
"drupal/key_value_field": "^1.3" | ||
}, | ||
"suggest": { | ||
"dpc-sdp/tide_api:^3.0.0": "Allows to use Drupal in headless mode" | ||
"dpc-sdp/tide_api:^4.0.0": "Allows to use Drupal in headless mode" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change, good job!
JIRA
https://digital-vic.atlassian.net/browse/SRM-942
Changes
Drupal 10 compatibility changes.