Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
eb4cee6d
Commit
eb4cee6d
authored
3 years ago
by
Carsten Rose
Browse files
Options
Downloads
Patches
Plain Diff
Reformat debug code
parent
f57ddcd5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#5088
passed
3 years ago
Stage: before
Stage: build
Stage: selenium
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation/Debug.rst
+66
-36
66 additions, 36 deletions
Documentation/Debug.rst
with
66 additions
and
36 deletions
Documentation/Debug.rst
+
66
−
36
View file @
eb4cee6d
...
...
@@ -127,8 +127,12 @@ Mail Log page (Table MailLog)
For debugging purposes you may like to add a Mail Log page in the frontend.
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element)
Note: If you do not use/have the Ggroup table, then remove the "# Filters" block.
::
.. warning::
Use this code only on access restricted pages. GET/POST Parameter might be used to get access to unintended content.
Note: If you do not use/have the Ggroup table, then remove the "# Filters" block.::
# Page parameters
1.sql = SELECT @grId := '{{grId:C0:digit}}' AS _grId
...
...
@@ -194,9 +198,11 @@ Setup in :ref:`configuration`
Show log files realtime
-----------------------
Display QFQ log files in realtime.
.. warning::
Use this code only on access restricted pages. GET/POST Parameter might be used to get access to unintended content.
The following QFQ code could be used for that purpose (put it
in a QFQ
P
age
C
ontent element
)
::
Display QFQ log files in realtime. Put the following code
in a QFQ
p
age
c
ontent element
.
::
#
# {{logfile:SU}}
...
...
@@ -225,46 +231,69 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
Form Submit Log page
--------------------
For debugging purposes you may like to add a Form Submit Log page in the frontend.
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element)::
.. warning::
Use this code only on access restricted pages. GET/POST Parameter might be used to get access to unintended content.
Check the Form Submit Log page to see what have been submitted. Put the following code in a QFQ page content element.::
#
# Show all form submit. Optional filter by Form or FeUser.
#
# {{formId:SC0}}
# {{feUser:SCE:alnumx}}
# Filters
20.shead = <form onchange='this.submit()' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'>
20 {
sql = SELECT "'", id, IF(id = '{{formId:SC0}}', "' selected>", "'>"), name
FROM Form
ORDER BY name
head = <label for='formId'>Form:</label> <select name='formId' id='formId' class='form-control'><option value=0></option>
tail = </select>
rbeg = <option value=
rend = </option>
}
30 {
sql = SELECT feUser, IF(feUser = '{{feUser:SCE:alnumx}}', "' selected>", "'>"), feUser
FROM FormSubmitLog
GROUP BY feUser ORDER BY feUser
head = <label for='feUser'>FE User:</label> <select name='feUser' id='feUser' class='form-control'><option value=''></option>
tail = </select>
rbeg = <option value='
rend = </option>
10 {
sql = SELECT ''
shead = <form onchange='this.submit()' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'>
stail = </form>
# Dropdown: Form
20 {
sql = SELECT "'", f.id, IF( f.id = '{{formId:SC0}}', "' selected>", "'>"), f.name, ' (', QIFEMPTY(COUNT(fsl.id),'-'), ')'
FROM Form AS f
LEFT JOIN FormSubmitLog AS fsl
ON fsl.formId=f.id
GROUP BY f.id
ORDER BY f.name
head = <label for='formId'>Form:</label> <select name='formId' id='formId' class='form-control'><option value=0></option>
tail = </select>
rbeg = <option value=
rend = </option>
}
# Dropdown: feUser
30 {
sql = SELECT feUser, IF(feUser = '{{feUser:SCE:alnumx}}', "' selected>", "'>"), feUser, ' (', COUNT(id), ')'
FROM FormSubmitLog
WHERE feUser!=''
GROUP BY feUser
ORDER BY feUser
head = <label for='feUser'>FE User:</label> <select name='feUser' id='feUser' class='form-control'><option value=''></option>
tail = </select>
rbeg = <option value='
# just to sync syntax highlighter: '
rend = </option>
}
}
30.stail = </form>
# Show Log
50 {
sql = SELECT l.id
, CONCAT('<b>Form</b>: ', f.name
, '<br><b>Record Id</b>: ', l.recordId
, '<br><b>Fe User</b>: ', l.feUser
, '<br><b>Date</b>: ', l.created
, '<br><b>Page Id</b>: ', l.pageId
, '<br><b>Session Id</b>: ', l.sessionId
, '<br><b>IP Address</b>: ', l.clientIp
, '<br><b>User Agent</b>: ', l.userAgent
, '<br><b>SIP Data</b>: <div style="margin-left:20px;">'
,
'
<script>var data =
'
, l.sipData, "; for (var key in data) {
, CONCAT('<b>Form</b>: ', f.name
, '<br><b>Record Id</b>: ', l.recordId
, '<br><b>Fe User</b>: ', l.feUser
, '<br><b>Date</b>: ', l.created
, '<br><b>Page Id</b>: ', l.pageId
, '<br><b>Session Id</b>: ', l.sessionId
, '<br><b>IP Address</b>: ', l.clientIp
, '<br><b>User Agent</b>: ', l.userAgent
, '<br><b>SIP Data</b>: <div style="margin-left:20px;">'
,
"
<script>var data =
JSON.parse('"
, l.sipData, "
')
; for (var key in data) {
document.write('<b>' + key + '</b>: ' + data[key] + '<br>'); }</script>", '</div>')
, CONCAT(
'
<script>var data =
'
, l.formData, "; for (var key in data) {
, CONCAT(
"
<script>var data =
JSON.parse('"
, l.formData, "
')
; for (var key in data) {
document.write('<b>' + key + '</b>: ' + data[key] + '<br>'); }</script>")
FROM FormSubmitLog AS l
LEFT JOIN Form AS f
...
...
@@ -281,3 +310,4 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
fbeg = <td>
fend = </td>
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment