Skip to content
Snippets Groups Projects
Commit 8d2d0059 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Implements #11262. stored Procedure: QNBSP - replace space by ' '

parent a328b735
No related branches found
No related tags found
No related merge requests found
Pipeline #7203 passed
......@@ -1911,6 +1911,18 @@ Example::
One possibility how `LF` comes into the database is with form elements of type `textarea` if the user presses `enter` inside.
.. _qnbsp:
QNBSP: Convert space to ' '
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The SQL function QNBSP(text) replaces ` ` (space) by ` `. This prevents unwanted line breaks in text.
E.g. the title 'Prof. Dr.' should never be breaked: QNBSP('Prof. Dr.')
Example::
10.sql = SELECT QNBSP(Person.title) FROM Person
.. _qmore-truncate-long-text:
QMORE: Truncate Long Text - more/less
......
......@@ -139,7 +139,6 @@ class DatabaseUpdate {
$this->checkT3QfqConfig($old, $new);
if ($dbUpdate === SYSTEM_DB_UPDATE_NEVER) {
return;
}
......@@ -381,7 +380,7 @@ class DatabaseUpdate {
return ACTION_FUNCTION_UPDATE_NEVER;
}
$functionSql = file_get_contents(__DIR__ . '/../../Sql/function.sql');
$functionSql = file_get_contents(__DIR__ . '/../../Sql/' . QFQ_FUNCTION_SQL);
$functionHash = hash('md5', $functionSql);
if ($functionHash === $oldFunctionsHash) {
......
......@@ -86,6 +86,22 @@ BEGIN
RETURN output;
END;
###
#
# QNBSP(input)
# replaces ' ' in `input` with '&nbsp'
#
DROP FUNCTION IF EXISTS QNBSP;
CREATE FUNCTION QNBSP(input TEXT)
RETURNS TEXT
DETERMINISTIC
SQL SECURITY INVOKER
BEGIN
DECLARE output TEXT;
SET output = REPLACE(input, ' ', ' ');
RETURN output;
END;
###
#
# QIFEMPTY(input, token)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment