Commit 252d60d8 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'F7682InputWithAutoHeight'

parents 58852778 3f09f57e
Pipeline #1474 passed with stage
in 2 minutes and 5 seconds
......@@ -53,12 +53,12 @@ Neue Versionsnummer
* Update the version number in this document (topic 6)
* Commit & Push new version changes to master branch:
New version 19.1.2
New version 19.1.3
6) **New Tag**:
git tag v19.1.2
git push -u origin v19.1.2
git tag v19.1.3
git push -u origin v19.1.3
7) Tickets:
* Schliessen und der QFQ Version zuweisen.
......
......@@ -2283,7 +2283,7 @@ Format: [<url>] or [<mode>|<url>]
* `http://www.example.com/index.html?a=123#bottom`
* `website.html?a=123#bottom`
* `?<T3 Alias pageid>&a=123#bottom, ?id=<T3 page id>&a=123#bottom`
* `?id=<T3 Alias pageid>&a=123#bottom, ?id=<T3 page id>&a=123#bottom`
* `{{SELECT ...}}`
* `<mode>|<url>`
......
......@@ -36,6 +36,43 @@ Features
Bug Fixes
^^^^^^^^^
Version 19.1.3
--------------
Date: 28.1.2019
Notes
^^^^^
* If a variable violates a sanitize class, the substituted result can now be configured: a) !!<class>!!, b) '0', c) '', d) '<custom message>'.
* Alerts (based on _link class), might now show only 'ok' (alone, without 'cancel').
* Excel Import - three new options: importNamedSheetsOnly, importSetReadDataOnly, importListSheetNames
Features
^^^^^^^^
* SQL Error / underlining in exception dialog: Add two SQL errors to be underlined in exceptions. Extend to "... in 'order clause'"
* Extend allowed SQL commands in QFQ vars (have been already subscribed in that way in Manual.rst).
* #6914 / Customized typeMessageViolation. Incl. unit tests. New escape mode 'C' - escapes ':' by '\'.' - useful for variables in variable definition.
* #7743 / Move error messages to Constants.php. Unit tests use those constants now. 'data-pattern-error' only delivered
if a 'pattern' is given. 'required' attribute only delivered is set. Detection of 'pattern error' on per QFQ default,
custom instance wide, per form or per FormElement - per FormElement overwrites other. Move default pattern to constants.
Make default error text more specific (only if default error text is not explicit set in config, form or form-element)
* #7747 / New options to import Excel files: importNamedSheetsOnly, importSetReadDataOnly, importListSheetNames
* #7684 / Optional hide second button (cancel) in link/question alerts.
* fillStoreVar: Replace setStore() with appendToStore()
Bug Fixes
^^^^^^^^^
* #7743 / Form-Element: Explicit given '0' for MIN or MAX has been interpreted as 'not set'.
* #7702 / Form,Form-Element: Unnecessary evaluation of column 'noteInternal' / 'adminNote'.
* #7695 / Form/URL Forward: pageAlias not substituted.
* #7686 / FormAction/sendmail: uninitialised sendMailAttachment.
* #7685 / Open FormElement from QFQ error message and save modified record: report error about missing {{formId:F}}.
* FormElement.type=select: fixed problem with dynamic update and mode=readonly - list was still selectable.
* Hint to skip leading zeros in version number.
Version 19.1.2
--------------
......
......@@ -2,8 +2,8 @@
[general]
project = QFQ - Quick Form Query
version = 19.01
release = 19.01.2
version = 19.1
release = 19.1.3
t3author = Carsten Rose
copyright = since 2017 by the author
......
......@@ -57,9 +57,9 @@ copyright = u'2017, Carsten Rose'
# built documents.lease
#
# The short X.Y version.
version = '19.01'
version = '19.1'
# The full version, including alpha/beta/rc tags.
release = '19.01.2'
release = '19.1.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -136,24 +136,14 @@ class AbstractException extends \Exception {
$arrMerged = OnArray::htmlentitiesOnArray(array_merge($arrMsg, $arrDebugShow));
if (!empty($os = $arrMerged[ERROR_MESSAGE_OS] ?? '')) {
// $arrMerged[EXCEPTION_SQL_FINAL] = self::sqlHighlightError($os);
$beforeMatch = htmlentities("the right syntax to use near '", ENT_QUOTES);
$afterMatch = htmlentities("' at line [0-9]*$", ENT_QUOTES);
if (preg_match("/mysqli: 1064.*$beforeMatch.*$afterMatch/", $os)) {
$match = explode("$beforeMatch", $os, 2)[1];
$match = preg_split("/$afterMatch/", $match)[0];
if(!empty($match )) {
$splitSql = explode($match, $arrMerged[EXCEPTION_SQL_FINAL]);
$match = Support::wrapTag('<span class="qfq-wavy-underline">', $match);
$highlightedSql = implode($match, $splitSql);
$arrMerged[EXCEPTION_SQL_FINAL] = $highlightedSql;
}
}
// [ mysqli: 1146 ] Table 'qfq_db.UNKNOWN_TABLE' doesn't exist
$before=$this->getTableToken( html_entity_decode($arrMerged[ERROR_MESSAGE_OS],ENT_QUOTES));
$arrMerged[EXCEPTION_SQL_FINAL] = $this->sqlHighlightError($arrMerged[ERROR_MESSAGE_OS], 'mysqli: 1146', $arrMerged[EXCEPTION_SQL_FINAL], $before, "' doesn't exist");
$arrMerged[EXCEPTION_SQL_FINAL] = $this->sqlHighlightError($arrMerged[ERROR_MESSAGE_OS], 'mysqli: 1064', $arrMerged[EXCEPTION_SQL_FINAL], "the right syntax to use near '", "' at line [0-9]*$");
// [ mysqli: 1054 ] Unknown column "noPsp.pspElement' in 'field list" | "... in 'order clause'"
$arrMerged[EXCEPTION_SQL_FINAL] = $this->sqlHighlightError($arrMerged[ERROR_MESSAGE_OS], 'mysqli: 1054', $arrMerged[EXCEPTION_SQL_FINAL], "Unknown column '", "' in '");
}
$htmlDebug = OnArray::arrayToHtmlTable(
array_merge($arrForm, $arrMerged),
'Debug', EXCEPTION_TABLE_CLASS);
......@@ -180,6 +170,49 @@ class AbstractException extends \Exception {
$arrShow = OnArray::htmlentitiesOnArray($arrShow);
return $this->formatMessageUser($arrShow) . $htmlDebug;
}
/**
* Extract 'beforeMatch', incl. dynamic db name as token to do underlining later.
* E.g.: "[ mysqli: 1146 ] Table 'qfq_db.UNKNOWN_TABLE' doesn't exist"
* return: "Table 'qfq_db."
*
* @param $os
* @return string
*/
private function getTableToken($os) {
$subject = "Table '.*' ";
$arr = preg_match("/$subject/", $os, $matches);
$arr= explode('.', $matches[0]??'');
return ($arr[0]??'') . '.';
}
/**
* @param $os
* @param $code
* @param $sql
* @param $before
* @param $after
* @return string
*/
private function sqlHighlightError($os, $code, $sql, $before, $after) {
$beforeMatch = htmlentities($before, ENT_QUOTES);
$afterMatch = htmlentities($after, ENT_QUOTES);
if (preg_match("/$code.*$beforeMatch.*$afterMatch/", $os)) {
$arr = explode("$beforeMatch", $os, 2);
$match = $arr[1] ?? '';
$match = preg_split("/$afterMatch/", $match)[0];
if (!empty($match)) {
$splitSql = explode($match, $sql);
$match = Support::wrapTag('<span class="qfq-wavy-underline">', $match);
$highlightedSql = implode($match, $splitSql);
$sql = $highlightedSql;
}
}
return $sql;
}
/**
......
......@@ -12,7 +12,7 @@ $EM_CONF[$_EXTKEY] = array(
'dependencies' => 'fluid,extbase',
'clearcacheonload' => true,
'state' => 'stable',
'version' => '19.01.2',
'version' => '19.1.3',
'constraints' => [
'depends' => [
'typo3' => '6.0.0-9.2.99',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment