Verified Commit 41637546 authored by Dave Long's avatar Dave Long
Browse files

fix: #3611853 Correct error deprecation message for...

fix: #3611853 Correct error deprecation message for \Drupal\Core\Htmx\HtmxRequestInfoTrait::getHtmxTrigger

By: fathershawn
By: nicxvan
parent e179aaec
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -90,12 +90,12 @@ protected function getHtmxTarget(): string {
   * @return string
   *   The value of the 'HX-Trigger' header, or an empty string if not set.
   *
   * @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. There is
   *   no replacement.
   * @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use
   * HtmxRequestInfoTrait::getHtmxSource() instead.
   * @see https://www.drupal.org/node/3583674
   */
  protected function getHtmxTrigger(): string {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3583674', E_USER_DEPRECATED);
    @trigger_error(__METHOD__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use HtmxRequestInfoTrait::getHtmxSource() instead. See https://www.drupal.org/node/3583674', E_USER_DEPRECATED);
    return $this->getRequest()->headers->get('HX-Trigger', '');
  }

+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ public function testGetHtmxTarget(): void {
  #[IgnoreDeprecations]
  public function testGetHtmxTrigger(): void {
    // Test with the header not present.
    $this->expectUserDeprecationMessage('Drupal\Core\Htmx\HtmxRequestInfoTrait::getHtmxTrigger() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3583674');
    $this->expectUserDeprecationMessage('Drupal\Core\Htmx\HtmxRequestInfoTrait::getHtmxTrigger() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use HtmxRequestInfoTrait::getHtmxSource() instead. See https://www.drupal.org/node/3583674');
    $this->assertEquals('', $this->getHtmxTrigger());
  }