@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use ::triggerHeader() instead. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
if(is_array($data)){
$data=json_encode($data);
}
@@ -517,9 +521,13 @@ public function triggerAfterSettleHeader(string|array $data): static {
* @return static
* Self for chaining.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use ::triggerHeader() instead. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
if(is_array($data)){
$data=json_encode($data);
}
@@ -933,9 +941,13 @@ public function disable(): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
@@ -952,9 +964,13 @@ public function disabledElt(string $descriptor): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
* use the approach given in the change record.
* @see https://www.drupal.org/node/3583674
* @see https://htmx.org/attributes/hx-disinherit/
*/
publicfunctiondisinherit(string$names):static{
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
@@ -989,9 +1005,13 @@ public function encoding(string $method = 'multipart/form-data'): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
* use the approach given in the change record.
* @see https://www.drupal.org/node/3583674
* @see https://htmx.org/attributes/hx-ext/
*/
publicfunctionext(string$names):static{
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
$this->createStringAttribute('hx-ext',$names);
return$this;
}
@@ -1027,9 +1047,13 @@ public function headers(array $headerValues): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
* use the approach given in the change record.
* @see https://www.drupal.org/node/3583674
* @see https://htmx.org/attributes/hx-history/
*/
publicfunctionhistory():static{
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
@@ -1111,9 +1134,13 @@ public function indicator(string $selector): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
* use the approach given in the change record.
* @see https://www.drupal.org/node/3583674
* @see https://htmx.org/attributes/hx-inherit/
*/
publicfunctioninherit(string$attributes):static{
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
@@ -1131,7 +1158,6 @@ public function inherit(string $attributes): static {
* the first name with `not`, as in ['not param1', 'param2', 'param3'].
* - To only submit some parameters, use an array of parameter names as in
* ['param1', 'param2', 'param3'].
* parameters use an array, pre
*
* @param string|string[] $filter
* The filter string or strings.
@@ -1139,9 +1165,13 @@ public function inherit(string $attributes): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
* use the approach given in the change record.
* @see https://www.drupal.org/node/3583674
* @see https://htmx.org/attributes/hx-params/
*/
publicfunctionparams(string|array$filter):static{
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
if(is_array($filter)){
$filter=implode(',',$filter);
}
@@ -1178,9 +1208,13 @@ public function preserve(): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
* use the approach given in the change record.
* @see https://www.drupal.org/node/3583674
* @see https://htmx.org/attributes/hx-prompt/
*/
publicfunctionprompt(string$message):static{
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
@@ -1235,9 +1269,13 @@ public function replaceUrl(bool|Url $value): static {
* @return static
* Returns this object to allow chaining methods.
*
* @deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead,
* use the approach given in the change record.
* @see https://www.drupal.org/node/3583674
* @see https://htmx.org/attributes/hx-request/
*/
publicfunctionrequest(array$configValues):static{
@trigger_error(__METHOD__.'() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. The corresponding attribute is removed from htmx v.4. An alternate approach is available and outlined in the change record. See https://www.drupal.org/node/3583674',E_USER_DEPRECATED);
@@ -64,8 +64,13 @@ protected function isHtmxHistoryRestoration(): bool {
*
* @return string
* The value of the 'HX-Prompt' 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.
* @see https://www.drupal.org/node/3583674
*/
protectedfunctiongetHtmxPrompt():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);
@@ -84,8 +89,13 @@ 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.
* @see https://www.drupal.org/node/3583674
*/
protectedfunctiongetHtmxTrigger():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);
@@ -196,8 +197,10 @@ public function testHxHeaders(): void {
/**
* Test request method.
*/
#[IgnoreDeprecations]
publicfunctiontestHxRequest():void{
$values=['timeout'=>100,'credentials'=>FALSE];
$this->expectUserDeprecationMessage('Drupal\Core\Htmx\Htmx::request() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. The corresponding attribute is removed from htmx v.4. An alternate approach is available and outlined in the change record. See https://www.drupal.org/node/3583674');
'disabledElt'=>'Drupal\Core\Htmx\Htmx::disabledElt() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',
'disinherit'=>'Drupal\Core\Htmx\Htmx::disinherit() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',
'ext'=>'Drupal\Core\Htmx\Htmx::ext() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',
'history'=>'Drupal\Core\Htmx\Htmx::history() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',
'inherit'=>'Drupal\Core\Htmx\Htmx::inherit() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',
'params'=>'Drupal\Core\Htmx\Htmx::params() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',
'prompt'=>'Drupal\Core\Htmx\Htmx::prompt() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Instead, use the approach given in the change record. See https://www.drupal.org/node/3583674',
$this->expectUserDeprecationMessage('Drupal\Core\Htmx\Htmx::triggerAfterSettleHeader() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use ::triggerHeader() instead. See https://www.drupal.org/node/3583674');
$this->expectUserDeprecationMessage('Drupal\Core\Htmx\Htmx::triggerAfterSettleHeader() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use ::triggerHeader() instead. See https://www.drupal.org/node/3583674');
$this->htmx->triggerAfterSettleHeader([
'showMessage'=>[
'level'=>'info',
@@ -270,7 +275,9 @@ public function testTriggerAfterSettleHeaderComplex(): void {
/**
* Test trigger header with simple data.
*/
#[IgnoreDeprecations]
publicfunctiontestTriggerAfterSwapHeader():void{
$this->expectUserDeprecationMessage('Drupal\Core\Htmx\Htmx::triggerAfterSwapHeader() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use ::triggerHeader() instead. See https://www.drupal.org/node/3583674');
$this->expectUserDeprecationMessage('Drupal\Core\Htmx\Htmx::triggerAfterSwapHeader() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. Use ::triggerHeader() instead. See https://www.drupal.org/node/3583674');
@@ -83,13 +84,11 @@ public function testIsHtmxHistoryRestoration(): void {
/**
* Tests the getHtmxPrompt method.
*/
#[IgnoreDeprecations]
publicfunctiontestGetHtmxPrompt():void{
// Test with the header not present.
$this->expectUserDeprecationMessage('Drupal\Core\Htmx\HtmxRequestInfoTrait::getHtmxPrompt() 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->assertEquals('',$this->getHtmxPrompt());
// Test with the header present.
$this->request->headers->set('HX-Prompt','Enter a value');
$this->assertEquals('Enter a value',$this->getHtmxPrompt());
}
/**
@@ -107,13 +106,11 @@ public function testGetHtmxTarget(): void {
/**
* Tests the getHtmxTrigger method.
*/
#[IgnoreDeprecations]
publicfunctiontestGetHtmxTrigger():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');