Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Jan-Hendrik Willms
Stud.IP
Commits
048c922b
Commit
048c922b
authored
5 months ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fix and improve forum category detection, fixes
#4850
Closes
#4850
Merge request
!3635
parent
263ab995
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/classes/JsonApi/Models/ForumEntry.php
+14
-11
14 additions, 11 deletions
lib/classes/JsonApi/Models/ForumEntry.php
with
14 additions
and
11 deletions
lib/classes/JsonApi/Models/ForumEntry.php
+
14
−
11
View file @
048c922b
...
...
@@ -2,11 +2,11 @@
namespace
JsonApi\Models
;
/*
* @property string category_id
string
primary key
* @property string seminar_id
string
foreign key
* @property string entry_name
string
database_column
* @property string pos
int
/*
*
* @property string
$
category_id primary key
* @property string
$
seminar_id foreign key
* @property string
$
entry_name database_column
* @property string
$
pos
*/
class
ForumEntry
extends
\SimpleORMap
...
...
@@ -18,15 +18,18 @@ class ForumEntry extends \SimpleORMap
'forum_entries.lft <= ? AND forum_entries.rgt >= ? AND forum_entries.seminar_id = ? AND forum_entries.depth = 1 ORDER BY forum_entries.lft ASC'
,
[(
int
)
$targetEntry
[
'lft'
],
(
int
)
$targetEntry
[
'rgt'
],
$targetEntry
[
'seminar_id'
]]
);
$category
=
ForumCat
::
findBySQL
(
'LEFT JOIN forum_categories_entries AS fce USING (category_id)
if
(
count
(
$parentEntries
)
>
0
)
{
$category
=
ForumCat
::
findOneBySQL
(
'LEFT JOIN forum_categories_entries AS fce USING (category_id)
WHERE fce.topic_id = ?'
,
[
$parentEntries
[
0
]
->
id
]
);
[
$parentEntries
[
0
]
->
id
]
);
}
if
(
empty
(
$category
))
{
$category
=
ForumCat
::
findBySql
(
"seminar_id = ? AND
entry_name = 'Allg
em
e
in
'
"
,
$category
=
ForumCat
::
find
One
BySql
(
"seminar_id = ? AND
category_id = s
emin
ar_id
"
,
[
$targetEntry
->
seminar_id
]
);
}
...
...
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