This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php | |
index 6ccf8fd..6415e6b 100644 | |
--- a/core/lib/Drupal/Core/Config/TypedConfigManager.php | |
+++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php | |
@@ -153,15 +153,15 @@ public function getDefinition($base_plugin_id, $exception_on_invalid = TRUE, $va | |
// If the sub type has a bracket then lets look that up as well. | |
if (isset($value) && strpos($definition['type'], ']')) { | |
$sub_type = $this->replaceName($definition['type'], $value); | |
- $merge = $definitions[$sub_type]; | |
- $definition = NestedArray::mergeDeepArray(array($merge, $definition), TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// playground.module file. | |
/** | |
* Implements hook_form_FORM_ID_alter(). | |
*/ | |
function playground_form_user_login_block_alter(&$form, &$form_state) { | |
$form['preference'] = array( | |
'#type' => 'select', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// playground.module | |
function playground_form_alter(&$form, &$form_state, $form_id) { | |
switch($form_id) { | |
case 'webform_client_form_1': | |
global $user; | |
if ($user->uid < 0) { | |
$form['submitted']['username']['#access'] = FALSE; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LogicException: Settings can not be serialized. This probably means you are serializing an object that has an indirect reference to the Settings object. Adjust your code so that is not necessary. in Drupal\Core\Site\Settings->__sleep() (line 67 of core/lib/Drupal/Core/Site/Settings.php). | |
serialize(Array) | |
Drupal\Component\Serialization\PhpSerialize::encode(Array) | |
Drupal\Core\KeyValueStore\DatabaseStorageExpirable->setWithExpire('form-pRbhHqrMfS0Ze2xmZj6YbazW8LgYH8vIFsV8ZBOwTow', Array, 21600) | |
Drupal\Core\Form\FormCache->setCache('form-pRbhHqrMfS0Ze2xmZj6YbazW8LgYH8vIFsV8ZBOwTow', Array, Object) | |
Drupal\Core\Form\FormBuilder->setCache('form-pRbhHqrMfS0Ze2xmZj6YbazW8LgYH8vIFsV8ZBOwTow', Array, Object) | |
Drupal\Core\Form\FormBuilder->processForm('error_style_form', Array, Object) | |
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) | |
Drupal\Core\Controller\FormController->getContentResult(Object, Object) | |
call_user_func_array(Array, Array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select GROUP_CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(filename, '/', -1), '.', 1) SEPARATOR ',') as module from system \G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php | |
index 16f68b0..bfe0211 100644 | |
--- a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php | |
+++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php | |
@@ -90,7 +90,7 @@ protected function prepareTimezone($timezone) { | |
* The formatted value of the date. | |
*/ | |
public function format($format, $settings = array()) { | |
- $settings['langcode'] = !empty($settings['langcode']) ? $settings['langcode'] : $this->langcode; | |
+ $langcode = !empty($settings['langcode']) ? $settings['langcode'] : $this->langcode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pjonckiere: vijaycs85: I'm a bit confused on that callback code, is there any way to use the new function without the $callback variable? | |
14:32 pjonckiere: vijaycs85: https://www.drupal.org/node/2429443 | |
14:32 pjonckiere: vijaycs85: or is that impossible due to the variables? | |
14:32 vijaycs85: pjonckiere: not sure, how to.. we need to pass the language code | |
14:33 vijaycs85: pjonckiere: and I don't think we can make the language as property (as you can see it's calculated above the code from $this->langcode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = field_file_load($data->node_data_field_media_file_field_media_file_fid); | |
$file_info = image_get_info($file['filepath']); | |
if ($file_info) { | |
$bytes = $file_info['file_size']; | |
$s = array('B', 'KB', 'MB', 'GB', 'TB', 'PB'); | |
$e = floor(log($bytes)/log(1024)); | |
print sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e)))); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$user = new User($stoage); |