Commit 1c764a35 authored by catch's avatar catch
Browse files

Issue #3465827 by andypost, kim.pepper, arunkumark, catch, berdir, quietone:...

Issue #3465827 by andypost, kim.pepper, arunkumark, catch, berdir, quietone: Stop passing E_USER_ERROR to trigger_error() on PHP 8.4

(cherry picked from commit 1bf85911)
parent a8fd59d2
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ protected function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) {
        $this->_changed($edit->orig, $edit->closing);
      }
      else {
        trigger_error('Unknown edit type', E_USER_ERROR);
        trigger_error('Unknown edit type', E_USER_WARNING);
      }
    }
    $this->_end_block();
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ public function __toString() {
    catch (\Exception $e) {
      // User errors in __toString() methods are considered fatal in the Drupal
      // error handler.
      trigger_error(get_class($e) . ' thrown while calling __toString on a ' . static::class . ' object in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage(), E_USER_ERROR);
      trigger_error(get_class($e) . ' thrown while calling __toString on a ' . static::class . ' object in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage(), E_USER_WARNING);
      // In case we are using another error handler that did not fatal on the
      // E_USER_ERROR, we terminate execution. However, for test purposes allow
      // a return value.
+3 −3
Original line number Diff line number Diff line
@@ -381,7 +381,7 @@ protected function sendNoJsPlaceholders($html, $no_js_placeholders, AttachedAsse
          throw $e;
        }
        else {
          trigger_error($e, E_USER_ERROR);
          trigger_error($e, E_USER_WARNING);
          continue;
        }
      }
@@ -417,7 +417,7 @@ protected function sendNoJsPlaceholders($html, $no_js_placeholders, AttachedAsse
          throw $e;
        }
        else {
          trigger_error($e, E_USER_ERROR);
          trigger_error($e, E_USER_WARNING);
          continue;
        }
      }
@@ -615,7 +615,7 @@ protected function sendPlaceholders(array $placeholders, array $placeholder_orde
            throw $e;
          }
          else {
            trigger_error($e, E_USER_ERROR);
            trigger_error($e, E_USER_WARNING);
          }
        }
      }
+2 −2
Original line number Diff line number Diff line
@@ -195,9 +195,9 @@ public function testBigPipe(): void {
    // database drivers the ability to insert their own limit and offset
    // functionality.
    $records = $connection->select('watchdog', 'w')->fields('w')->orderBy('wid', 'DESC')->range(0, 2)->execute()->fetchAll();
    $this->assertEquals(RfcLogLevel::ERROR, $records[0]->severity);
    $this->assertEquals(RfcLogLevel::WARNING, $records[0]->severity);
    $this->assertStringContainsString('Oh noes!', (string) unserialize($records[0]->variables)['@message']);
    $this->assertEquals(RfcLogLevel::ERROR, $records[1]->severity);
    $this->assertEquals(RfcLogLevel::WARNING, $records[1]->severity);
    $this->assertStringContainsString('You are not allowed to say llamas are not cool!', (string) unserialize($records[1]->variables)['@message']);

    // Verify that 4xx responses work fine. (4xx responses are handled by
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public function testToString(): void {
    (string) $text;
    restore_error_handler();

    $this->assertEquals(E_USER_ERROR, $this->lastErrorNumber);
    $this->assertEquals(E_USER_WARNING, $this->lastErrorNumber);
    $this->assertMatchesRegularExpression('/Exception thrown while calling __toString on a .*MockObject_TranslatableMarkup_.* object in .*TranslatableMarkupTest.php on line [0-9]+: Yes you may./', $this->lastErrorMessage);
  }