mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 02:13:15 +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)
|
private function resolveSearchIncludes(Request $request)
|
||||||
{
|
{
|
||||||
$includes = [];
|
$includes = [
|
||||||
|
'results.stories.records'
|
||||||
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'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request->attributes->get('_extended', false)) {
|
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.subdefs',
|
||||||
'results.records.metadata',
|
'results.records.metadata',
|
||||||
'results.records.caption',
|
'results.records.caption',
|
||||||
'results.records.status'
|
'results.records.status'
|
||||||
];
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $includes;
|
return $includes;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use League\Fractal\TransformerAbstract;
|
|||||||
class RecordTransformer extends TransformerAbstract
|
class RecordTransformer extends TransformerAbstract
|
||||||
{
|
{
|
||||||
protected $availableIncludes = ['thumbnail', 'technical_informations', 'subdefs', 'metadata', 'status', 'caption'];
|
protected $availableIncludes = ['thumbnail', 'technical_informations', 'subdefs', 'metadata', 'status', 'caption'];
|
||||||
|
|
||||||
protected $defaultIncludes = ['thumbnail', 'technical_informations'];
|
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;
|
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;
|
CREATE SCHEMA IF NOT EXISTS ab_test;CREATE SCHEMA IF NOT EXISTS db_test;
|
||||||
'
|
'
|
||||||
|
|
||||||
if ! ./bin/developer system:uninstall > /dev/null 2>&1
|
if ! ./bin/developer system:uninstall > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
rm -f config/configuration.yml config/configuration-compiled.php
|
mv config/configuration.yml{,.backup}
|
||||||
|
rm -f config/configuration-compiled.php
|
||||||
fi
|
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
|
./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
|
case "$INSTALL_MODE" in
|
||||||
|
|||||||
Reference in New Issue
Block a user