Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14381

Text Reparser fails with empty sql fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.2.0-RC1
    • 4.0.0-a1, 3.2.0-b2
    • Other
    • None
    • Apache 2.4.7, MySQL 5.6.15, PHP 5.5.8

      Hello

      In my 3.2x extension, i use Text Reparser plugin in a migration file, because i store text with BBCodes.

      But my sql fields can be empty (like a forum descritpion, or a user signature), and when i enable my extension after an update, i get an error (see screenshot).

      Indeed, content length is shorter than $config['min_post_chars'], and en/posting.php is not included, but I would not have to include this file for reparse a field already stored; empty fields should not be reparsed.

      I suggest to update sql query in phpbb\textreparser\row_based_plugin::get_records_by_range_query like this:

      		$sql = 'SELECT ' . implode(', ', $fields) . '
      			FROM ' . $this->table . '
      			WHERE ' . $columns['id'] . ' BETWEEN ' . $min_id . ' AND ' . $max_id . '
      				AND ' . $columns['text'] . ' <> ""';
      

      for exclude empty fields.

        1. Capture.JPG
          166 kB
          Erwan Nader
        2. screenshot.JPG
          168 kB
          Erwan Nader

            nicofuma nicofuma
            ErnadoO Erwan Nader
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: