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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
ca10fde9
Commit
ca10fde9
authored
2 years ago
by
Elmar Ludwig
Committed by
David Siegfried
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
partly fix broken SQL queries, re #1579
Merge request
studip/studip!1008
parent
061434e7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/course/overview.php
+2
-3
2 additions, 3 deletions
app/controllers/course/overview.php
lib/classes/I18NStringDatafield.php
+5
-4
5 additions, 4 deletions
lib/classes/I18NStringDatafield.php
lib/models/User.class.php
+3
-3
3 additions, 3 deletions
lib/models/User.class.php
with
10 additions
and
10 deletions
app/controllers/course/overview.php
+
2
−
3
View file @
ca10fde9
...
...
@@ -96,9 +96,8 @@ class Course_OverviewController extends AuthenticatedController
foreach
((
array
)
$rule
[
'attributes'
]
as
$val
)
{
if
(
$val
==
1
)
{
// Es gibt also Zusatzangaben. Nun noch überprüfen ob der Nutzer diese Angaben schon gemacht hat...
$count
=
DataField
::
countBySql
(
"LEFT JOIN datafields_entries ON datafields_entries.datafield_id = datafields.datafield_id
WHERE datafield_id.object_type = 'usersemdata' AND datafields_entries.sec_range_id = ? AND datafields_entries.range_id = ?"
,
[
$this
->
course_id
,
$GLOBALS
[
'user'
]
->
id
]
$count
=
DataField
::
countBySql
(
"LEFT JOIN datafields_entries USING (datafield_id) WHERE object_type = ? AND sec_range_id = ? AND range_id = ?"
,
[
'usersemdata'
,
$this
->
course_id
,
$GLOBALS
[
'user'
]
->
id
]
);
if
(
!
$count
)
{
$show
=
true
;
...
...
This diff is collapsed.
Click to expand it.
lib/classes/I18NStringDatafield.php
+
5
−
4
View file @
ca10fde9
...
...
@@ -59,8 +59,8 @@ class I18NStringDatafield extends I18NString
[
$object_id
[
0
],
$object_id
[
1
],
$object_id
[
2
]]
);
foreach
(
$this
->
lang
as
$lang
=>
$value
)
{
if
(
mb_
strlen
(
$value
))
{
Data
F
ield
::
create
(
if
(
strlen
(
$value
))
{
Data
f
ield
EntryModel
::
create
(
[
'datafield_id'
=>
$object_id
[
0
],
'range_id'
=>
$object_id
[
1
],
...
...
@@ -87,14 +87,15 @@ class I18NStringDatafield extends I18NString
public
static
function
load
(
$object_id
,
$table
=
''
,
$field
=
''
,
$base
=
null
)
{
if
(
is_null
(
$base
))
{
$
base
=
Data
F
ield
::
findOneBySQL
(
$
df
=
Data
f
ield
EntryModel
::
findOneBySQL
(
"`datafield_id` = ? AND `range_id` = ? AND `sec_range_id` = ? AND `lang` = ''"
,
$object_id
);
$base
=
$df
->
content
;
}
$table
=
null
;
$field
=
null
;
return
new
self
(
$base
->
content
,
self
::
fetchDataForField
(
$object_id
,
$table
,
$field
),
return
new
self
(
$base
,
self
::
fetchDataForField
(
$object_id
,
$table
,
$field
),
compact
(
'object_id'
,
'table'
,
'field'
));
}
...
...
This diff is collapsed.
Click to expand it.
lib/models/User.class.php
+
3
−
3
View file @
ca10fde9
...
...
@@ -296,12 +296,12 @@ class User extends AuthUserMd5 implements Range, PrivacyObject
public
static
function
findByDatafield
(
$datafield_id
,
$value
)
{
return
User
::
findMany
(
SimpleCollection
::
createFromArray
(
array_column
(
DatafieldEntryModel
::
findBySQL
(
'datafield_id = :datafield_id AND content = :value'
,
compact
(
'datafield_id'
,
'value'
)
)
)
->
pluck
(
'range_id'
)
)
,
'range_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