GeneralTips.rst 9.35 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.. ==================================================
.. ==================================================
.. ==================================================
.. Header hierarchy
.. ==
..  --
..   ^^
..    ""
..     ;;
..      ,,
..
.. --------------------------------------------used to the update the records specified ------
.. Best Practice T3 reST: https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingReST/CheatSheet.html
..             Reference: https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingReST/Index.html
.. Italic *italic*
.. Bold **bold**
.. Code ``text``
.. External Links: `Bootstrap <http://getbootstrap.com/>`_
19
.. Internal Link: :ref:downloadButton (default url text) or :ref:`download Button<downloadButton>` (explicit url text)
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.. Add Images:    .. image:: ../Images/a4.jpg
..
..
.. Admonitions
..           .. note::   .. important::     .. tip::     .. warning::
.. Color:   (blue)       (orange)           (green)      (red)
..
.. Definition:
.. some text becomes strong (only one line)
..      description has to indented

.. -*- coding: utf-8 -*- with BOM.

.. include:: Includes.txt


.. _help:

General Tips
============

41
42
43
44
45
46
47
Typo3 Debug Mode
----------------

Manual to always display Exceptions and Errors in the backend and frontend of Typo3:

`Typo3: Debugging and Development Setup <https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/ErrorAndExceptionHandling/Examples/Index.html#debugging-and-development-setup>`_

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Errors
------

* Does the error happens on every *page* or only on a specific one?
* Does the error happens on every *form* or only on a specific one?

Tips:

* On general errors:

  * Always check the Javascript console of your browser, see :ref:`javascriptProblem`.
  * Always check the Webserver log files.

Procedure to Find an Irreproducible Error
-----------------------------------------

* Find out the date and time on which the error occurred as precisely as possible
* Find out the user-name of the person who experienced the error
* Search the logs at the time of the Error:

  * qfq.log

70
71
72
    * location: fileadmin/protected/qfqProject/log/qfq.log

      * **NOTE**: The `log` directory has been moved into `qfqProject` with a recent upgrade of QFQ. For backwards compatibility logs are still stored in `fileadmin/protected/log/` if that directory already exists.
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
    * Look for error messages which were sent to the user at that time. (search for user-name in file)
    * Look at actions performed during the time of Error

  * FormSubmitLog

    * location: table named 'FormSubmitLog' in the qfq database
    * In the SQL Table FormSubmitLog search the column FEUser for the user-name
    * does the data (in the column formData) submitted at the time of the error coincide with the data saved in the database?

  * sql.log

    * location: fileadmin/protected/log/sql.og
    * search for the form that was active when the error occurred:

      * e.g.: If the form is named 'requestGreview' search for 'form:requestGreview'

Caching
-------

Content, generated by QFQ, is generally not cached. But the QFQ content records are cached by Typo3. This means if there is
a content element 'Insert Records' on a page 'A' which includes a QFQ record from page 'B' and such QFQ record is modified (the SQL
definition, not the delivered output), the new definition becomes by default only visible if the cached is cleared.

To simplify the situation, set on the page of the QFQ record (B) in Page TS Config: ::

  TCEMAIN.clearCacheCmd = pages


QFQ specific
------------

A variable {{<var>}} is empty
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The sanitize rule is violated and therefore the value has been removed. Set {{<var>:<store>:all}} as a test.

Page is white: no HTML code at all
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This should not happen.

The PHP process stopped at all. Check the Apache error logfile, look for a stacktrace to find the latest function. Send
a bug report.

Problem with query or variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Specify the required sanitize class. Remember: for STORE_FORM and STORE_CLIENT the default is sanitize class is `digit`.
This means if the variable content is a string, this violates the sanitize class and the variable will not be replaced.

Tip on Form: put the problematic variable or SQL statement in the 'title' or note 'field' of a `FormElement`. This should show
the content. For SQL statements, remove the outer token (e.g. only one curly brace) to avoid triggering SQL: ::

  FE.title: Person { SELECT ... WHERE id={{buggyVar:alnumx}} }

Tip on Report: In case the query did not contain any double ticks, just wrap all but 'SELECT' in double ticks::

 Buggy query:  10.sql = SELECT id, ... FROM MyTable WHERE status={{myVar}} ORDER BY status
 Debug query:  10.sql = SELECT "id, ... FROM MyTable WHERE status={{myVar}} ORDER BY status"

Error read file config.qfq.php: syntax error on line xx
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check the given line number. If it's an SQL statement, enclose it in single or double ticks.


Output a text, substitute embedded QFQ variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The content will be copied to '_text'. In `10.tail` than the '{{text:R}}' will be substituted with all known variables.
Note the '-' in '{{text:RE::-}}', this will prevent that QFQ escapes any character from the content. ::

    10 {
      sql = SELECT no.text AS _text
               FROM Note AS no
               WHERE id=...
      tail = {{text:RE::-}}
    }

TypeAhead list with T3 page alias names - use of the T3 DB
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To define a typeahead list of T3 page alias names::

    FE.type = text
    FE.parameter.typeAheadSql = SELECT p.alias FROM {{dbNameT3:Y}}.Pages AS p WHERE p.deleted=0 AND p.alias!='' AND p.alias LIKE ? ORDER BY p.alias LIMIT 20
    FE.parameter.typeAheadMinLength = 1

.. _setFeUserPassword:

Set FE-User password
^^^^^^^^^^^^^^^^^^^^

To offer an FE User the possibility to change the own T3 FE password, create a form: ::

    f.name = changeFePassword
    f.title = Change Password
    f.table = Person   (QFQ Table, not T3)
    f.permitNew = never
    f.permitEdit = sip

    fe[1].name = myPassword
    fe[1].title = Password
    fe[1].class = native
    fe[1].type = password
    fe[1].mode = required
    fe[1].parameter = retype

    fe[2].class = action
    fe[2].type = afterSave
    fe[2].parameter = sqlAfter={{UPDATE {{dbNameT3:Y}}.fe_users SET password='{{myPassword:FE:all:p}}' WHERE username='{{feUser:T}}' AND deleted=0

Call the form via SIP on an existing record. Often QFQ has an own table for persons and also the current user exist in T3
fe_users table.


Logging
-------

General webserver error log
^^^^^^^^^^^^^^^^^^^^^^^^^^^

For apache: `/var/log/apache2/error_log`

Especially if you got a blank page (no rendering at all), this is typically an uncaught PHP error. Check the error message
and report the bug (https://qfq.io > Contact).

Call to undefined function qfq\\mb_internal_encoding()
""""""""""""""""""""""""""""""""""""""""""""""""""""""

Check that all required php modules are installed. See :ref:`preparation`.


Error Messages
--------------

Internal Server Error
^^^^^^^^^^^^^^^^^^^^^

The browser shows a red popup with 'Internal Server Error'. The message is generated in the browser. Happens e.g. an AJAX
request response of QFQ (=Server) is broken. This might happen e.g. if PHP can't start successfully or PHP fails to run
due to  a missing php module or broken configuration.

Oops, an error occurred! Code: 20180612205917761fc593
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You see this message on all places where a QFQ content record should produce some output. Typically the extension fails
to load. If the error message disappears when the QFQ extension is disabled (instead a message `qfq_qfq can't be rendered`
is shown), than QFQ is the problem.

Search the given code in `typo3temp/logs/*`, in this example 20180612205917761fc593. You'll should find a stacktrace with
a more detailed message.

The error might occur if there are problematic characters in config.qfq.php, like single or double ticks inside strings,
wich are not enclosed (correctly).

.. _`sendEmailProblem`:

sendEmail: Error => TLS setup failed
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Switch off the TLS encryption. In :ref:`configuration` specify for *config.sendEMailOptions*: ::

   -o tls=no

.. _`javascriptProblem`:

Javascript problem
------------------

Open the 'Webdeveloper Tools' (FF: F12, Chrome/Opera: Right mouse click > Inspect Element) in your browser, switch to
'console' and reload the page. Inspect the messages.

TinyMCE
-------

Glyph Icons in '<span>'
^^^^^^^^^^^^^^^^^^^^^^^

TinyMCE forbids by default HTML tag 'span' with 'class' attribute. E.g.: ::

    <span class="glyphicon glyphicon-user"></span>

To allow it, add 'span' to the valid elements in the FormElement.parameter field: ::

    editor-extended_valid_elements = span[class|style]

The HTML span tag has to be added via 'source' view. At least in TinyMCE 4.7.13, the glyph is still not shown in the
editor.
Carsten  Rose's avatar
Carsten Rose committed
262
263
264
265
266
267
268
269
270
271

FE User
-------

The FE User record (table: fe_users)

  * Has to exist.
  * Has to be assigned to at least one FE Group. Check ``fe_users.usergroup``.
  * Has to be assigned to a T3 page ``fe_users.pid``.
  * The T3 page has to be configured as ``record store`` on the T3 Plugin login box.
272
  * Access time has to be zero or a currently valid period.