mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Fix include resolution
Incorrect use of += operator on arrays caused the story includes to always be unset
This commit is contained in:
@@ -1407,24 +1407,26 @@ class V1Controller extends Controller
|
||||
*/
|
||||
private function resolveSearchIncludes(Request $request)
|
||||
{
|
||||
$includes = [];
|
||||
|
||||
if ($request->get('search_type') != SearchEngineOptions::RECORD_STORY) {
|
||||
$includes += [
|
||||
'results.stories.records.subdefs',
|
||||
'results.stories.records.metadata',
|
||||
'results.stories.records.caption',
|
||||
'results.stories.records.status'
|
||||
];
|
||||
}
|
||||
$includes = [
|
||||
'results.stories.records'
|
||||
];
|
||||
|
||||
if ($request->attributes->get('_extended', false)) {
|
||||
$includes += [
|
||||
if ($request->get('search_type') != SearchEngineOptions::RECORD_STORY) {
|
||||
$includes = array_merge($includes, [
|
||||
'results.stories.records.subdefs',
|
||||
'results.stories.records.metadata',
|
||||
'results.stories.records.caption',
|
||||
'results.stories.records.status'
|
||||
]);
|
||||
}
|
||||
|
||||
$includes = array_merge($includes, [
|
||||
'results.records.subdefs',
|
||||
'results.records.metadata',
|
||||
'results.records.caption',
|
||||
'results.records.status'
|
||||
];
|
||||
]);
|
||||
}
|
||||
|
||||
return $includes;
|
||||
|
||||
@@ -15,6 +15,7 @@ use League\Fractal\TransformerAbstract;
|
||||
class RecordTransformer extends TransformerAbstract
|
||||
{
|
||||
protected $availableIncludes = ['thumbnail', 'technical_informations', 'subdefs', 'metadata', 'status', 'caption'];
|
||||
|
||||
protected $defaultIncludes = ['thumbnail', 'technical_informations'];
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,9 +28,11 @@ SET @@global.wait_timeout= 999999;
|
||||
DROP SCHEMA IF EXISTS ab_test;DROP SCHEMA IF EXISTS db_test;
|
||||
CREATE SCHEMA IF NOT EXISTS ab_test;CREATE SCHEMA IF NOT EXISTS db_test;
|
||||
'
|
||||
|
||||
if ! ./bin/developer system:uninstall > /dev/null 2>&1
|
||||
then
|
||||
rm -f config/configuration.yml config/configuration-compiled.php
|
||||
mv config/configuration.yml{,.backup}
|
||||
rm -f config/configuration-compiled.php
|
||||
fi
|
||||
./bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=en --db-password=toor --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y $VERBOSITY
|
||||
case "$INSTALL_MODE" in
|
||||
|
||||
Reference in New Issue
Block a user