Commit 76518e6f authored by alexpott's avatar alexpott

Issue #1998708 by kim.pepper, kmcculloch: Use Symfony Request for block module.

parent cb07e913
......@@ -311,7 +311,7 @@ function _block_get_renderable_region($list = array()) {
// to other users. We therefore exclude user 1 from block caching.
$not_cacheable = $GLOBALS['user']->uid == 1 ||
count(module_implements('node_grants')) ||
!in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD'));
!\Drupal::request()->isMethodSafe();
foreach ($list as $key => $block) {
$settings = $block->get('settings');
......
......@@ -207,9 +207,10 @@ public function save(array $form, array &$form_state) {
*/
public function delete(array $form, array &$form_state) {
$destination = array();
if (isset($_GET['destination'])) {
$query = \Drupal::request()->query;
if (!is_null($query->get('destination'))) {
$destination = drupal_get_destination();
unset($_GET['destination']);
$query->remove('destination');
}
$block = $this->buildEntity($form, $form_state);
$form_state['redirect'] = array('block/' . $block->id() . '/delete', array('query' => $destination));
......
......@@ -880,9 +880,10 @@ function book_node_prepare(EntityInterface $node) {
if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) {
$node->book = array();
if (empty($node->nid) && isset($_GET['parent']) && is_numeric($_GET['parent'])) {
$query = \Drupal::request()->query;
if (empty($node->nid) && !is_null($query->get('parent')) && is_numeric($query->get('parent'))) {
// Handle "Add child page" links:
$parent = book_link_load($_GET['parent']);
$parent = book_link_load($query->get('parent'));
if ($parent && $parent['access']) {
$node->book['bid'] = $parent['bid'];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment