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 -Nur drupal-6.38/includes/common.inc drupal-6.41/includes/common.inc | |
--- drupal-6.38/includes/common.inc 2016-02-24 13:20:15.000000000 -0600 | |
+++ drupal-6.41/includes/common.inc 2018-02-22 10:29:07.000000000 -0600 | |
@@ -1499,7 +1499,7 @@ | |
); | |
if (!isset($options['external'])) { | |
- $options['external'] = menu_path_is_external($path); | |
+ $options['external'] = $_GET['q'] === $path ? FALSE : menu_path_is_external($path); | |
} |
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 | |
class MyObjectUnitTest extends UnitTestBase { | |
/** | |
* Mock object for one of the objects dependencies. | |
* | |
* @var \Project\Dependency|\Prophecy\Prophecy\ObjectProphecy | |
*/ | |
protected $dependency; |
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
/** | |
* @Block( | |
* id = "my_block", | |
* context = { | |
* "node" = @ContextDefinition("entity:node") | |
* } | |
* ) | |
*/ |
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
function _panopoly_convert_landing_pages() { | |
ctools_include('export'); | |
// Collect a list of all the page manager pages that are eligable for | |
// conversion. There are lots of features of page manager pages that don't | |
// work with Panelizer nodes! | |
$pages = array(); | |
foreach (ctools_export_load_object("page_manager_pages") as $page) { | |
// Skip pages that are in code at all (even if they are overridden in the | |
// database). |
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
/** | |
* A helper function to convert <img> tags to Media tokens where possible. | |
* | |
*/ | |
function hook_update_N() { | |
// A cache to help us when we encounter the same <img> tag multiple times. | |
$src_info_cache = array(); | |
// We'll work directly in the database for performance reasons. | |
$tables = 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
/** | |
* Convert 'Existing node' panes to 'Content item' panes. | |
*/ | |
function hook_update_N() { | |
// We're going to load the panes directly from the 'panels_pane' table and | |
// replace them with the new pane, reusing the same IDs and everything. | |
// Don't try this at home, kids! | |
$result = db_query("SELECT * FROM {panels_pane} WHERE type = 'node' AND subtype = 'node'"); | |
$serialized_fields = array('access', 'configuration', 'cache', 'style', 'css', 'extras', 'locks'); | |
foreach ($result as $pane) { |
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
/** | |
* Change content from one input format to another, deleting the old at the end. | |
* | |
* @param string $old_format | |
* Name of the old input format. | |
* @param string $new_type | |
* Name of the new input format. | |
*/ | |
function _myprofile_install_change_input_format($old_format, $new_format) { | |
// Change the format on all fields. |
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
access administration pages | |
access content | |
access content overview | |
access site reports | |
access user profiles | |
add media from remote sources | |
administer blocks | |
administer files | |
administer menu | |
administer nodes |
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 | |
$a = array('a' => 'a1', 'b' => 'b1'); | |
$b = array('a' => 'a2', 'b' => 'b2'); | |
print_r(array_map(NULL, $a, $b)); | |
/* RESULT: | |
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
/** | |
* Implements hook_module_implemnts_alter(). | |
*/ | |
function MODULE_module_implements_alter(&$implementations, $hook) { | |
if ($hook == 'user_login' && isset($implementations['oa_core'])) { | |
// The oa_core_user_login() function does some INSANE things with redirecting | |
// the user to their home dashboard and it messes up our registration workflow. | |
unset($implementations['oa_core']); | |
} | |
} |
NewerOlder