Skip to content
GitLab
Explore
Sign in
project
drupal
Compare revisions
bddce2cfbb491e2b5770dd7c18972d3f05d3771a to 8.2.x
Commits on Source (157)
f084a9eb
Issue
#2755545
by michielnugter, balagan: Docblock shows wrong code to use...
Nov 15, 2016
c5da97f9
SA-
CORE-2016
-005 by larowlan, xjm, David_Rothstein, Dave Reid, Crell, cilefen,...
Nov 16, 2016
a5faa633
Drupal 8.2.3
Nov 16, 2016
cb2e4791
Back to dev.
Nov 16, 2016
641e529e
Issue
#2353709
by quietone, maxocub, sidharthap, phenaproxima, Gábor Hojtsy:...
Nov 17, 2016
13b6d5fe
Issue
#2787923
by claudiu.cristea, dawehner, Jaesin, klausi: Add a...
Nov 17, 2016
6be65aa4
Revert "Issue
#2787923
by claudiu.cristea, dawehner, Jaesin, klausi: Add a...
Nov 17, 2016
5d2a732e
Issue
#2787923
by claudiu.cristea, dawehner, Jaesin, klausi: Add a...
Nov 17, 2016
aa8ed513
Issue
#2225293
by maxocub, penyaskito, Gábor Hojtsy, quietone, mitrpaka,...
Nov 18, 2016
210f8ff0
Issue
#2828642
by eojthebrave: Wrong method signature in documentation for subscribing to an event
Nov 18, 2016
c0a0e447
Issue
#2530634
by larowlan, Lendude, acbramley, webflo, dawehner, alexpott:...
Nov 18, 2016
8a757497
Issue
#2827748
by faline, felribeiro, tstoeckler: UuidItem should implement generateSampleValue
Nov 18, 2016
da7d1adf
Issue
#2828372
by Sut3kh: Mistake in hook_block_build_alter example
Nov 19, 2016
22e77be1
Issue
#2763787
by pwolanin, nerdstein, rlhawk, YesCT, tuutti, slasher13,...
Nov 21, 2016
30ed7a45
Issue
#2687851
by quietone, mikeryan, heddn, xjm, catch: Refactor run() method...
Nov 21, 2016
b9d9ae70
Issue
#2611066
by hussainweb, svendecabooter, brunodbo, generalredneck,...
Nov 21, 2016
598eac9b
Issue
#2621798
by quietone, hussainweb, kekkis, Yogesh Pawar, Jo Fitzgerald:...
Nov 21, 2016
afecabd8
Issue
#2707387
by quietone, Adita, heddn, phenaproxima, chx: D6/7->D8...
Nov 21, 2016
b6ea969e
Issue
#2829005
by claudiu.cristea: Add documentation for migration plugin discovery alter
Nov 21, 2016
95d3ed35
Issue
#2424791
by jibran, dpi, chx, Berdir: Entity query hardcodes...
Nov 21, 2016
a24ad5fc
Issue
#2828364
by dawehner: Default media stopped to render due to recursion...
Nov 23, 2016
3b0d1de7
Issue
#2679913
by kekkis, xjm, quietone: Fix use of markup in strings in Migrate UI
Nov 23, 2016
e7eb7eec
Issue
#2767643
by maxocub, TrevorBradley, sylus, heddn, mikeryan: Scalar to...
Nov 23, 2016
d002382f
Issue
#2746671
by Jo Fitzgerald, stella, andrewmacpherson, hussainweb, tom...
Nov 23, 2016
bcb0a90f
Issue
#2543568
by mikeryan, quietone, Ryan Weal, chipway, iMiksu, heddn,...
Nov 23, 2016
6c4dbeef
Issue
#2823600
by cebasqueira, jungle, amit.drupal, shashikant_chauhan:...
Nov 23, 2016
eb957dcd
Revert "Issue
#2746671
by Jo Fitzgerald, stella, andrewmacpherson, hussainweb,...
Nov 23, 2016
4d6d7b26
Issue
#2829791
by YesCT: Fix exception message for MachineNameController...
Nov 26, 2016
67f200ca
Issue
#2830196
by Lendude: Click sorting EntityOperations field leads to an Exception being thrown
Nov 26, 2016
29658ab0
Issue
#2820888
by lhangea, Wim Leers: Cookie authentication: the...
Nov 26, 2016
8af9db23
Issue
#2680379
by hchonov, mkalkbrenner, cilefen: services.yml and...
Nov 27, 2016
c1667f37
Issue
#2737719
by Wim Leers, dawehner: EntityResource: Provide comprehensive...
Nov 29, 2016
889f09f5
Issue
#2502195
by vijaycs85, larowlan:...
Nov 29, 2016
22334761
Revert "Issue
#2737719
by Wim Leers, dawehner: EntityResource: Provide...
Nov 29, 2016
16850db6
Issue
#2826389
by alexpott, kmoll, Robin Monks, Berdir, tbonomelli: Draggable...
Nov 29, 2016
4faed7fa
Issue
#2785997
by chanderbhushan, faline, mallezie, dawehner, mr.baileys:...
Nov 29, 2016
9d41d1cd
Issue
#2609252
by eiriksm, Ginovski, lokapujya, toncic, Arla, Berdir, chx:...
Nov 30, 2016
5d59627d
Issue
#2817115
by tstoeckler, dawehner, cilefen:...
Nov 30, 2016
4b1327d1
Issue
#2737719
by Wim Leers, dawehner: EntityResource: Provide comprehensive...
Nov 30, 2016
3b8e52ae
Issue
#2828319
by mradcliffe, Wim Leers, neclimdul: [regression] REST in...
Nov 30, 2016
c1a0b23d
Issue
#2830485
by klausi, michielnugter:...
Dec 01, 2016
410c1ff1
Issue
#2831525
by Berdir: Add DependencySerializationTrait to ContextDefinition
Dec 01, 2016
ec3d56ce
Issue
#2824576
by Wim Leers: Delete old REST test coverage:...
Dec 01, 2016
d34d9dc3
Issue
#2832013
by Wim Leers, michielnugter, catch:...
Dec 02, 2016
4253f4a1
Issue
#2811841
by hchonov, tstoeckler, Berdir: Add test coverage ensuring user...
Dec 02, 2016
41e5767e
Issue
#2830485
by klausi, catch, michielnugter:...
Dec 02, 2016
8ab9f5cd
Issue
#2810621
by Gábor Hojtsy, dawehner, xjm, jhodgdon, klausi, Wim Leers:...
Dec 05, 2016
b66cc869
Issue
#2826763
by tedbow, samuel.mortenson: Outside In motion selectors not scoped down enough
Dec 05, 2016
c10b035c
Issue
#2820200
by altrugon, bkosborne, thpoul: Display resize icon for CKEditor on Seven theme
Dec 05, 2016
0290c9c5
Issue
#2698909
by Berdir, andypost, jibran, tim.plunkett, lauriii, tstoeckler,...
Dec 05, 2016
5fc86bc2
Issue
#2756401
by claudiu.cristea, pfrenssen, sandervd, gielfeldt, alexpott,...
Dec 05, 2016
4ac6c3b6
Issue
#2827656
by maxocub, aditya.n: Once a process plugin returns multiple...
Dec 05, 2016
d9197f4b
Issue
#2717969
by Wim Leers, benelori, dawehner: REST views: Views field is...
Dec 06, 2016
0f9261cd
Issue
#2824165
by tim.plunkett: Remove brittleness from ConfigEntityStorageTest
Dec 06, 2016
52133682
Issue
#2726803
by hussainweb, jmuzz, Jo Fitzgerald: Field formatters with...
Dec 06, 2016
7b4d0650
Drupal 8.2.4
Dec 07, 2016
3736aba9
Back to dev.
Dec 07, 2016
a3863545
Issue
#2833462
by alexpott, tim.plunkett, Berdir: hook_requirements($phase =...
Dec 08, 2016
8d80f369
Issue
#2814035
by klausi, dawehner: Make $modules property protected on...
Dec 08, 2016
ebe5340e
Issue
#2309695
by quietone, alexpott, mikeryan, benjy: Add query batching to SqlBase
Dec 08, 2016
563340fb
Issue
#2826200
by claudiu.cristea, pfrenssen: Don't let the whole migration...
Dec 09, 2016
b912db19
Issue
#2130277
by phenaproxima, michaellenahan, Jo Fitzgerald, David...
Dec 09, 2016
607ae50a
Issue
#2828559
by amateescu, alexpott: More random fails in UpdatePathTestBase...
Dec 09, 2016
1af393a7
Issue
#2832246
by dangur: d6_profile_values.yml contains obsolete configuration
Dec 09, 2016
f3b493ff
Issue
#2830333
by Wim Leers, tedbow: All REST update path test coverage...
Dec 09, 2016
5971e539
Issue
#2834453
by dixon_: Remove dixon_ as maintainer for Comment module
Dec 12, 2016
18229750
Issue
#2829759
by ruloweb: Wrong @return doc comment in...
Dec 12, 2016
4e9c9440
Issue
#2822881
by Jo Fitzgerald, tstoeckler: Improve Entity URI checking in menu link migration
Dec 12, 2016
9d4b3684
Issue
#2835604
by Wim Leers, effulgentsia: BigPipe provides functionality, not...
Dec 14, 2016
36fe2d4e
Issue
#2746671
by Jo Fitzgerald, stella, andrewmacpherson, hussainweb, tom...
Dec 14, 2016
fa8939cc
Issue
#2729663
by dmsmidt, thpoul, SKAUGHT, Wim Leers, Lendude, droplet,...
Dec 14, 2016
1656c67d
Issue
#2781927
by pguillard, kiamlaluno, Eda, kiwimind: Improve description of...
Dec 14, 2016
5d0814d6
Issue
#2548713
by yongt9412, larowlan, Berdir, swentel, subhojit777,...
Dec 15, 2016
d0271bdc
Issue
#2828438
by Adita, Sam152, rachel_norfolk, timmillwood, jp.stacey:...
Dec 15, 2016
5e0a62dc
Revert "Issue
#2828438
by Adita, Sam152, rachel_norfolk, timmillwood,...
Dec 15, 2016
b062c68e
Issue
#2822296
by shashikant_chauhan, jp.stacey, xjm: Wrong fully qualified...
Dec 15, 2016
d237cfc4
Issue
#2828542
by claudiu.cristea, pfrenssen, cebasqueira, heddn, alexpott:...
Dec 15, 2016
05f0225a
Issue
#2836434
by alexpott, oriol_e9g, NickWilde, bradjones1, AdamPS,...
Dec 16, 2016
dae89165
Issue
#2823955
by Jo Fitzgerald, benjy, quietone, claudiu.cristea, mikeryan:...
Dec 19, 2016
23160fc5
Issue
#2651328
by aerozeppelin, GeduR: Views Handler Filter InOperator exposed...
Dec 19, 2016
69089e27
Issue
#2721725
by Vinay15, snehi, zerbash, er.pushpinderrana, jhodgdon, xjm,...
Dec 19, 2016
9924b5eb
Issue
#2830485
by michielnugter, klausi, tedbow, xjm, catch, tim.plunkett,...
Dec 19, 2016
f5c79614
Issue
#2836381
by phenaproxima, Wim Leers: Seven's entity-add-list template omits link attributes
Dec 21, 2016
54cec24c
Revert "Issue
#2836381
by phenaproxima, Wim Leers: Seven's entity-add-list...
Dec 22, 2016
4cc325fa
Issue
#2797169
by Wim Leers, Fabianx: Mark BigPipe as stable/non-experimental
Dec 23, 2016
df540a9f
Revert "Issue
#2797169
by Wim Leers, Fabianx: Mark BigPipe as stable/non-experimental"
Dec 23, 2016
e1c5a1e5
Issue
#2838678
by andrewmacpherson: Typo in documentation of ArgumentPluginBase - bellow
Dec 23, 2016
cc4a86da
Issue
#2837645
by cburschka: Views::viewsDataHelper declares the wrong return type
Jan 03, 2017
5a4db566
Issue
#2838954
by damiankloip: Ignore 'Transfer-Encoding' header in EntityResourceTestBase::testGet
Jan 03, 2017
6d42807a
Drupal 8.2.5
Jan 04, 2017
7a78e8bf
Back to dev.
Jan 04, 2017
eb237ea7
Issue
#2829484
by vegantriathlete, 20th, xjm: Incorrect spelling of possessive...
Jan 05, 2017
a43fe507
Issue
#2838205
by 20th, panshulk, Damien Flament: Invalid YAML syntax in code...
Jan 05, 2017
feea4699
Issue
#2786443
by alexpott, Berdir, RKopacz, milos.kroulik, generalconsensus:...
Jan 06, 2017
6663917e
Issue
#2623568
by yanniboi, claudiu.cristea, himanshugautam, anil280988,...
Jan 10, 2017
e6904359
Issue
#2828559
by tacituseu, alexpott, mpdonadio, amateescu, hchonov, catch,...
Jan 10, 2017
308e0d77
Issue
#2794699
by Jo Fitzgerald, klausi, phenaproxima:...
Jan 10, 2017
8f380cf2
Issue
#2824827
by damiankloip, dawehner, Wim Leers, klausi:...
Jan 10, 2017
73503a05
Issue
#2599956
by claudiu.cristea, apmsooner: Handler admin summary is double escaped
Jan 11, 2017
fba87506
Issue
#2841948
by Mile23, dawehner: Modify run-tests.sh to show file paths of all discovered tests
Jan 11, 2017
57 additional commits have been omitted to prevent performance issues.
Expand all
Hide whitespace changes
Inline
Side-by-side
composer.lock
View file @
55845022
This diff is collapsed.
Click to expand it.
core/CHANGELOG.txt
View file @
55845022
Drupal 8.2.8, 2017-04-19
------------------------
- Fixed security issues. See SA-CORE-2017-002.
Drupal 8.2.7, 2017-03-15
------------------------
- Fixed security issues. See SA-CORE-2017-001.
Drupal 8.2.3, 2016-11-16
------------------------
- Fixed security issues. See SA-CORE-2016-005.
Drupal 8.2.0, 2016-10-05
------------------------
- Updated the git repository configuration to not normalize line endings for
...
...
core/MAINTAINERS.txt
View file @
55845022
...
...
@@ -123,7 +123,6 @@ Color
- ?
Comment
- Dick Olsson 'dixon_' https://www.drupal.org/u/dixon_
- Lee Rowlands 'larowlan' https://www.drupal.org/u/larowlan
- Andrey Postnikov 'andypost' https://www.drupal.org/u/andypost
...
...
core/composer.json
View file @
55845022
...
...
@@ -31,7 +31,7 @@
"symfony/psr-http-message-bridge"
:
"v0.2"
,
"zendframework/zend-diactoros"
:
"~1.1"
,
"composer/semver"
:
"~1.0"
,
"paragonie/random_compat"
:
"
~1.0
"
,
"paragonie/random_compat"
:
"
^1|^2
"
,
"asm89/stack-cors"
:
"~1.0"
},
"require-dev"
:
{
...
...
@@ -40,7 +40,7 @@
"jcalderonzumba/gastonjs"
:
"~1.0.2"
,
"jcalderonzumba/mink-phantomjs-driver"
:
"~0.3.1"
,
"mikey179/vfsStream"
:
"~1.2"
,
"phpunit/phpunit"
:
"
~
4.8"
,
"phpunit/phpunit"
:
"
>=
4.8
.28 <5
"
,
"symfony/css-selector"
:
"~2.8"
},
"replace"
:
{
...
...
core/core.api.php
View file @
55845022
...
...
@@ -1073,8 +1073,9 @@
* yourmodule/tests/src/Unit directory, according to the PSR-4 standard.
* - Your test class needs a phpDoc comment block with a description and
* a @group annotation, which gives information about the test.
* - Methods in your test class whose names start with 'test' are the actual
* test cases. Each one should test a logical subset of the functionality.
* - Add test cases by adding method names that start with 'test' and have no
* arguments, for example testYourTestCase(). Each one should test a logical
* subset of the functionality.
* For more details, see:
* - https://www.drupal.org/phpunit for full documentation on how to write
* PHPUnit tests for Drupal.
...
...
@@ -1110,9 +1111,9 @@
* set up content types and similar procedures.
* - In some cases, you may need to write a test module to support your test;
* put such modules under the yourmodule/tests/modules directory.
* -
Methods in your
test c
l
ass
whose
names start with 'test'
,
and
which
have
*
no
arguments,
are the actual test c
ase
s
. Each one should test a logical
* subset of the functionality
, and each one
runs in a new, isolated test
* -
Add
test cas
e
s
by adding method
names
that
start with 'test' and have
no
* arguments,
for example testYourTestC
ase
()
. Each one should test a logical
* subset of the functionality
. Each method
runs in a new, isolated test
* environment, so it can only rely on the setUp() method, not what has
* been set up by other test methods.
* For more details, see:
...
...
@@ -1121,6 +1122,52 @@
* - @link oo_conventions Object-oriented programming topic @endlink for more
* on PSR-4, namespaces, and where to place classes.
*
* @section write_functional_phpunit Write functional PHP tests (phpunit)
* Functional tests extend the BrowserTestBase base class, and use PHPUnit as
* their underlying framework. They use a simulated browser, in which the test
* can click links, visit URLs, post to forms, etc. To write a functional test:
* - Extend \Drupal\Tests\BrowserTestBase.
* - Place the test in the yourmodule/tests/src/Functional/ directory and use
* the \Drupal\Tests\yourmodule\Functional namespace.
* - Add a @group annotation. For example, if the test is for a Drupal 6
* migration process, the group core uses is migrate_drupal_6. Use yourmodule
* as the group name if the test does not belong to another larger group.
* - You may also override the default setUp() method, which can be used to set
* up content types and similar procedures. Don't forget to call the parent
* method.
* - In some cases, you may need to write a test module to support your test;
* put such modules under the yourmodule/tests/modules directory.
* - Add test cases by adding method names that start with 'test' and have no
* arguments, for example testYourTestCase(). Each one should test a logical
* subset of the functionality. Each method runs in a new, isolated test
* environment, so it can only rely on the setUp() method, not what has
* been set up by other test methods.
* For more details, see:
* - https://www.drupal.org/docs/8/phpunit/phpunit-browser-test-tutorial for
* a full tutorial on how to write functional PHPUnit tests for Drupal.
* - https://www.drupal.org/phpunit for the full documentation on how to write
* PHPUnit tests for Drupal.
*
* @section write_jsfunctional_phpunit Write functional JavaScript tests (phpunit)
* To write a functional test that relies on JavaScript:
* - Extend \Drupal\FunctionalJavaScriptTests\JavascriptTestBase.
* - Place the test into the yourmodule/tests/src/FunctionalJavascript/
* directory and use the \Drupal\Tests\yourmodule\FunctionalJavascript
* namespace.
* - Add a @group annotation. Use yourmodule as the group name if the test does
* not belong to another larger group.
* - Set up PhantomJS; see http://phantomjs.org/download.html.
* - To run tests, see core/tests/README.md.
* - When clicking a link/button with Ajax behavior attached, keep in mind that
* the underlying browser might take time to deliver changes to the HTML. Use
* $this->assertSession()->assertWaitOnAjaxRequest() to wait for the Ajax
* request to finish.
* For more details, see:
* - https://www.drupal.org/docs/8/phpunit/phpunit-javascript-testing-tutorial
* for a full tutorial on how to write PHPUnit JavaScript tests for Drupal.
* - https://www.drupal.org/phpunit for the full documentation on how to write
* PHPUnit tests for Drupal.
*
* @section running Running tests
* You can run both Simpletest and PHPUnit tests by enabling the core Testing
* module (core/modules/simpletest). Once that module is enabled, tests can be
...
...
@@ -2493,7 +2540,7 @@ function hook_validation_constraint_alter(array &$definitions) {
* this class is subscribed to, and which methods on the class should be
* called for each one. Example:
* @code
* public function getSubscribedEvents() {
* public
static
function getSubscribedEvents() {
* // Subscribe to kernel terminate with priority 100.
* $events[KernelEvents::TERMINATE][] = array('onTerminate', 100);
* // Subscribe to kernel request with default priority of 0.
...
...
core/includes/entity.inc
View file @
55845022
...
...
@@ -539,12 +539,12 @@ function entity_get_display($entity_type, $bundle, $view_mode) {
* When the entity form display is not available in configuration, you can
* create a new EntityFormDisplay object using:
* @code
* $values =
('entity_form_display',
array(
* $values = array(
* 'targetEntityType' => $entity_type,
* 'bundle' => $bundle,
* 'mode' => $form_mode,
* 'status' => TRUE,
*
)
);
* );
* \Drupal::entityTypeManager()
* ->getStorage('entity_form_display')
* ->create($values);
...
...
core/includes/install.core.inc
View file @
55845022
...
...
@@ -20,6 +20,7 @@
use
Drupal\Core\Site\Settings
;
use
Drupal\Core\StringTranslation\Translator\FileTranslation
;
use
Drupal\Core\StackMiddleware\ReverseProxyMiddleware
;
use
Drupal\Core\StreamWrapper\PublicStream
;
use
Drupal\Core\Extension\ExtensionDiscovery
;
use
Drupal\Core\DependencyInjection\ContainerBuilder
;
use
Drupal\Core\Url
;
...
...
@@ -1036,6 +1037,21 @@ function install_base_system(&$install_state) {
// Install system.module.
drupal_install_system
(
$install_state
);
// Prevent the installer from using the system temporary directory after the
// system module has been installed.
if
(
drupal_valid_test_ua
())
{
// While the temporary directory could be preset/enforced in settings.php
// like the public files directory, some tests expect it to be configurable
// in the UI. If declared in settings.php, they would no longer be
// configurable. The temporary directory needs to match what is set in each
// test types ::prepareEnvironment() step.
$temporary_directory
=
dirname
(
PublicStream
::
basePath
())
.
'/temp'
;
file_prepare_directory
(
$temporary_directory
,
FILE_MODIFY_PERMISSIONS
|
FILE_CREATE_DIRECTORY
);
\Drupal
::
configFactory
()
->
getEditable
(
'system.file'
)
->
set
(
'path.temporary'
,
$temporary_directory
)
->
save
();
}
// Call file_ensure_htaccess() to ensure that all of Drupal's standard
// directories (e.g., the public files directory and config directory) have
// appropriate .htaccess files. These directories will have already been
...
...
core/includes/install.inc
View file @
55845022
...
...
@@ -1044,10 +1044,11 @@ function drupal_check_module($module) {
*
* Example of .info.yml file:
* @code
* name = Minimal
* description = Start fresh, with only a few modules enabled.
* dependencies[] = block
* dependencies[] = dblog
* name: Minimal
* description: Start fresh, with only a few modules enabled.
* dependencies:
* - block
* - dblog
* @endcode
*
* @param $profile
...
...
core/includes/schema.inc
View file @
55845022
...
...
@@ -74,7 +74,7 @@ function drupal_get_schema_versions($module) {
* module is not installed.
*/
function
drupal_get_installed_schema_version
(
$module
,
$reset
=
FALSE
,
$array
=
FALSE
)
{
static
$versions
=
array
();
$versions
=
&
drupal_static
(
__FUNCTION__
,
array
()
)
;
if
(
$reset
)
{
$versions
=
array
();
...
...
core/lib/Drupal.php
View file @
55845022
...
...
@@ -81,7 +81,7 @@ class Drupal {
/**
* The current system version.
*/
const
VERSION
=
'8.2.
3
-dev'
;
const
VERSION
=
'8.2.
8
-dev'
;
/**
* Core API compatibility.
...
...
@@ -556,8 +556,7 @@ public static function linkGenerator() {
* Renders a link with a given link text and Url object.
*
* This method is a convenience wrapper for the link generator service's
* generate() method. For detailed documentation, see
* \Drupal\Core\Routing\LinkGeneratorInterface::generate().
* generate() method.
*
* @param string $text
* The link text for the anchor tag.
...
...
core/lib/Drupal/Component/Render/FormattableMarkup.php
View file @
55845022
...
...
@@ -147,7 +147,7 @@ public function jsonSerialize() {
* A call like:
* @code
* $string = "%output_text";
* $arguments = ['output_text' => 'text output here.'];
* $arguments = ['
%
output_text' => 'text output here.'];
* $this->placeholderFormat($string, $arguments);
* @endcode
* makes the following HTML code:
...
...
core/lib/Drupal/Core/Config/ConfigManager.php
View file @
55845022
...
...
@@ -297,7 +297,7 @@ public function getConfigEntitiesToChangeOnDependencyRemoval($type, array $names
$dependency_manager
=
$this
->
getConfigDependencyManager
();
$dependents
=
$this
->
findConfigEntityDependentsAsEntities
(
$type
,
$names
,
$dependency_manager
);
$original_dependencies
=
$dependents
;
$delete_uuids
=
$update_uuids
=
[];
$delete_uuids
=
[];
$return
=
[
'update'
=>
[],
...
...
@@ -305,6 +305,13 @@ public function getConfigEntitiesToChangeOnDependencyRemoval($type, array $names
'unchanged'
=>
[],
];
// Create a map of UUIDs to $original_dependencies key so that we can remove
// fixed dependencies.
$uuid_map
=
[];
foreach
(
$original_dependencies
as
$key
=>
$entity
)
{
$uuid_map
[
$entity
->
uuid
()]
=
$key
;
}
// Try to fix any dependencies and find out what will happen to the
// dependency graph. Entities are processed in the order of most dependent
// first. For example, this ensures that Menu UI third party dependencies on
...
...
@@ -340,8 +347,9 @@ public function getConfigEntitiesToChangeOnDependencyRemoval($type, array $names
}
}
if
(
$fixed
)
{
// Remove the fixed dependency from the list of original dependencies.
unset
(
$original_dependencies
[
$uuid_map
[
$dependent
->
uuid
()]]);
$return
[
'update'
][]
=
$dependent
;
$update_uuids
[]
=
$dependent
->
uuid
();
}
}
// If the entity cannot be fixed then it has to be deleted.
...
...
@@ -354,8 +362,8 @@ public function getConfigEntitiesToChangeOnDependencyRemoval($type, array $names
}
// Use the lists of UUIDs to filter the original list to work out which
// configuration entities are unchanged.
$return
[
'unchanged'
]
=
array_filter
(
$original_dependencies
,
function
(
$dependent
)
use
(
$delete_uuids
,
$update_uuids
)
{
return
!
(
in_array
(
$dependent
->
uuid
(),
$delete_uuids
)
||
in_array
(
$dependent
->
uuid
(),
$update_uuids
)
);
$return
[
'unchanged'
]
=
array_filter
(
$original_dependencies
,
function
(
$dependent
)
use
(
$delete_uuids
)
{
return
!
(
in_array
(
$dependent
->
uuid
(),
$delete_uuids
));
});
return
$return
;
...
...
core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
View file @
55845022
...
...
@@ -34,6 +34,11 @@ abstract class DraggableListBuilder extends ConfigEntityListBuilder implements F
*/
protected
$weightKey
=
FALSE
;
/**
* {@inheritdoc}
*/
protected
$limit
=
FALSE
;
/**
* The form builder.
*
...
...
core/lib/Drupal/Core/Database/Query/Select.php
View file @
55845022
...
...
@@ -5,7 +5,6 @@
use
Drupal\Core\Database\Database
;
use
Drupal\Core\Database\Connection
;
/**
* Query builder for SELECT statements.
*
...
...
@@ -456,6 +455,22 @@ public function preExecute(SelectInterface $query = NULL) {
// Modules may alter all queries or only those having a particular tag.
if
(
isset
(
$this
->
alterTags
))
{
// Many contrib modules as well as Entity Reference in core assume that
// query tags used for access-checking purposes follow the pattern
// $entity_type . '_access'. But this is not the case for taxonomy terms,
// since the core Taxonomy module used to add term_access instead of
// taxonomy_term_access to its queries. Provide backwards compatibility
// by adding both tags here instead of attempting to fix all contrib
// modules in a coordinated effort.
// TODO:
// - Extract this mechanism into a hook as part of a public (non-security)
// issue.
// - Emit E_USER_DEPRECATED if term_access is used.
// https://www.drupal.org/node/2575081
$term_access_tags
=
array
(
'term_access'
=>
1
,
'taxonomy_term_access'
=>
1
);
if
(
array_intersect_key
(
$this
->
alterTags
,
$term_access_tags
))
{
$this
->
alterTags
+=
$term_access_tags
;
}
$hooks
=
array
(
'query'
);
foreach
(
$this
->
alterTags
as
$tag
=>
$value
)
{
$hooks
[]
=
'query_'
.
$tag
;
...
...
core/lib/Drupal/Core/DrupalKernel.php
View file @
55845022
...
...
@@ -1031,8 +1031,17 @@ protected function initializeSettings(Request $request) {
$prefix
=
Settings
::
getApcuPrefix
(
'class_loader'
,
$this
->
root
);
$apc_loader
=
new
ApcClassLoader
(
$prefix
,
$this
->
classLoader
);
$this
->
classLoader
->
unregister
();
$apc_loader
->
register
();
// The optimized classloader might be persistent and store cache misses.
// For example, once a cache miss is stored in APCu clearing it on a
// specific web-head will not clear any other web-heads. Therefore
// fallback to the composer class loader that only statically caches
// misses.
$old_loader
=
$this
->
classLoader
;
$this
->
classLoader
=
$apc_loader
;
// Our class loaders are preprended to ensure they come first like the
// class loader they are replacing.
$old_loader
->
register
(
TRUE
);
$apc_loader
->
register
(
TRUE
);
}
}
...
...
core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
View file @
55845022
...
...
@@ -348,13 +348,10 @@ public static function getEntityLabels(array $entities) {
public
static
function
extractEntityIdFromAutocompleteInput
(
$input
)
{
$match
=
NULL
;
// Take "label (entity id)', match the ID from parenthesis when it's a
// number.
if
(
preg_match
(
"/.+\s\((\d+)\)/"
,
$input
,
$matches
))
{
$match
=
$matches
[
1
];
}
// Match the ID when it's a string (e.g. for config entity types).
elseif
(
preg_match
(
"/.+\s\(([\w.]+)\)/"
,
$input
,
$matches
))
{
// Take "label (entity id)', match the ID from inside the parentheses.
// @todo Add support for entities containing parentheses in their ID.
// @see https://www.drupal.org/node/2520416
if
(
preg_match
(
"/.+\s\(([^\)]+)\)/"
,
$input
,
$matches
))
{
$match
=
$matches
[
1
];
}
...
...
core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php
View file @
55845022
...
...
@@ -303,6 +303,19 @@ public function fieldAccess($operation, FieldDefinitionInterface $field_definiti
// Get the default access restriction that lives within this field.
$default
=
$items
?
$items
->
defaultAccess
(
$operation
,
$account
)
:
AccessResult
::
allowed
();
// Explicitly disallow changing the entity ID and entity UUID.
if
(
$operation
===
'edit'
)
{
if
(
$field_definition
->
getName
()
===
$this
->
entityType
->
getKey
(
'id'
))
{
return
$return_as_object
?
AccessResult
::
forbidden
(
'The entity ID cannot be changed'
)
:
FALSE
;
}
elseif
(
$field_definition
->
getName
()
===
$this
->
entityType
->
getKey
(
'uuid'
))
{
// UUIDs can be set when creating an entity.
if
(
$items
&&
(
$entity
=
$items
->
getEntity
())
&&
!
$entity
->
isNew
())
{
return
$return_as_object
?
AccessResult
::
forbidden
(
'The entity UUID cannot be changed'
)
->
addCacheableDependency
(
$entity
)
:
FALSE
;
}
}
}
// Get the default access restriction as specified by the access control
// handler.
$entity_default
=
$this
->
checkFieldAccess
(
$operation
,
$field_definition
,
$account
,
$items
);
...
...
core/lib/Drupal/Core/Entity/EntityViewBuilder.php
View file @
55845022
...
...
@@ -9,6 +9,7 @@
use
Drupal\Core\Field\FieldItemListInterface
;
use
Drupal\Core\Language\LanguageManagerInterface
;
use
Drupal\Core\Render\Element
;
use
Drupal\Core\Theme\Registry
;
use
Drupal\Core\TypedData\TranslatableInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -54,6 +55,13 @@ class EntityViewBuilder extends EntityHandlerBase implements EntityHandlerInterf
*/
protected
$languageManager
;
/**
* The theme registry.
*
* @var \Drupal\Core\Theme\Registry
*/
protected
$themeRegistry
;
/**
* The EntityViewDisplay objects created for individual field rendering.
*
...
...
@@ -72,12 +80,15 @@ class EntityViewBuilder extends EntityHandlerBase implements EntityHandlerInterf
* The entity manager service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Theme\Registry $theme_registry
* The theme registry.
*/
public
function
__construct
(
EntityTypeInterface
$entity_type
,
EntityManagerInterface
$entity_manager
,
LanguageManagerInterface
$language_manager
)
{
public
function
__construct
(
EntityTypeInterface
$entity_type
,
EntityManagerInterface
$entity_manager
,
LanguageManagerInterface
$language_manager
,
Registry
$theme_registry
=
NULL
)
{
$this
->
entityTypeId
=
$entity_type
->
id
();
$this
->
entityType
=
$entity_type
;
$this
->
entityManager
=
$entity_manager
;
$this
->
languageManager
=
$language_manager
;
$this
->
themeRegistry
=
$theme_registry
?:
\Drupal
::
service
(
'theme.registry'
);
}
/**
...
...
@@ -87,7 +98,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
return
new
static
(
$entity_type
,
$container
->
get
(
'entity.manager'
),
$container
->
get
(
'language_manager'
)
$container
->
get
(
'language_manager'
),
$container
->
get
(
'theme.registry'
)
);
}
...
...
@@ -148,7 +160,6 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode) {
$this
->
moduleHandler
()
->
alter
(
'entity_view_mode'
,
$view_mode
,
$entity
,
$context
);
$build
=
array
(
'#theme'
=>
$this
->
entityTypeId
,
"#
{
$this
->
entityTypeId
}
"
=>
$entity
,
'#view_mode'
=>
$view_mode
,
// Collect cache defaults for this entity.
...
...
@@ -159,6 +170,11 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode) {
),
);
// Add the default #theme key if a template exists for it.
if
(
$this
->
themeRegistry
->
getRuntime
()
->
has
(
$this
->
entityTypeId
))
{
$build
[
'#theme'
]
=
$this
->
entityTypeId
;
}
// Cache the rendered output if permitted by the view mode and global entity
// type configuration.
if
(
$this
->
isViewModeCacheable
(
$view_mode
)
&&
!
$entity
->
isNew
()
&&
$entity
->
isDefaultRevision
()
&&
$this
->
entityType
->
isRenderCacheable
())
{
...
...
core/lib/Drupal/Core/Entity/Query/QueryInterface.php
View file @
55845022
...
...
@@ -35,13 +35,18 @@ public function getEntityTypeId();
*
* @param $field
* Name of the field being queried. It must contain a field name, optionally
* followed by a column name. The column can be "entity" for reference
* fields and that can be followed similarly by a field name and so on. Some
* examples:
* followed by a column name. The column can be the reference property,
* usually "entity", for reference fields and that can be followed
* similarly by a field name and so on. Additionally, the target entity type
* can be specified by appending the ":target_entity_type_id" to "entity".
* Some examples:
* - nid
* - tags.value
* - tags
* - tags.entity.name
* - tags.entity:taxonomy_term.name
* - uid.entity.name
* - uid.entity:user.name
* "tags" "is the same as "tags.value" as value is the default column.
* If two or more conditions have the same field names they apply to the
* same delta within that field. In order to limit the condition to a
...
...
core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
View file @
55845022
...
...
@@ -6,6 +6,8 @@
use
Drupal\Core\Entity\Query\QueryException
;
use
Drupal\Core\Entity\Sql\SqlEntityStorageInterface
;
use
Drupal\Core\Entity\Sql\TableMappingInterface
;
use
Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface
;
use
Drupal\Core\TypedData\DataReferenceDefinitionInterface
;
/**
* Adds tables and fields to the SQL entity query.
...
...
@@ -253,10 +255,20 @@ public function addField($field, $type, $langcode) {
$relationship_specifier
=
$specifiers
[
$key
+
1
];
$next_index_prefix
=
$relationship_specifier
;
}
$entity_type_id
=
NULL
;
// Relationship specifier can also contain the entity type ID, i.e.
// entity:node, entity:user or entity:taxonomy.
if
(
strpos
(
$relationship_specifier
,
':'
)
!==
FALSE
)
{
list
(
$relationship_specifier
,
$entity_type_id
)
=
explode
(
':'
,
$relationship_specifier
,
2
);
}
// Check for a valid relationship.
if
(
isset
(
$propertyDefinitions
[
$relationship_specifier
])
&&
$field_storage
->
getPropertyDefinition
(
'entity'
)
->
getDataType
()
==
'entity_reference'
)
{
// If it is, use the entity type.
$entity_type_id
=
$propertyDefinitions
[
$relationship_specifier
]
->
getTargetDefinition
()
->
getEntityTypeId
();
if
(
isset
(
$propertyDefinitions
[
$relationship_specifier
])
&&
$propertyDefinitions
[
$relationship_specifier
]
instanceof
DataReferenceDefinitionInterface
)
{
// If it is, use the entity type if specified already, otherwise use
// the definition.
$target_definition
=
$propertyDefinitions
[
$relationship_specifier
]
->
getTargetDefinition
();
if
(
!
$entity_type_id
&&
$target_definition
instanceof
EntityDataDefinitionInterface
)
{
$entity_type_id
=
$target_definition
->
getEntityTypeId
();
}
$entity_type
=
$this
->
entityManager
->
getDefinition
(
$entity_type_id
);
$field_storage_definitions
=
$this
->
entityManager
->
getFieldStorageDefinitions
(
$entity_type_id
);
// Add the new entity base table using the table and sql column.
...
...
Prev
1
2
3
4
5
…
21
Next