Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-14381

Text Reparser fails with empty sql fields

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0-a1, 3.2.0-b2
    • Fix Version/s: 3.2.0-RC1
    • Component/s: Other
    • Labels:
      None
    • Environment:
      Apache 2.4.7, MySQL 5.6.15, PHP 5.5.8

      Description

      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.

        Attachments

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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: