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 | |
namespace Drupal\commerce_shipping\Packer; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; | |
use Drupal\commerce_order\Entity\OrderInterface; | |
use Drupal\profile\Entity\ProfileInterface; | |
use Drupal\commerce_shipping\Packer\PackerInterface; | |
/** |
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
Problem: | |
When I was trying to setup commerce 2.x in Drupal 8 using Acquia cloud. Faced an issue while enabling Address module. | |
Error I was getting is `Address requires the commerceguys/zone library.`. | |
But, when I checked vendor directory, in commerceguys libraries only zone is missing in Acquia cloud, | |
but the same is present in my local instance. | |
Solution: | |
Commerceguys zone library is installed from git repo, so it was having `.git/`. | |
In Acquia cloud sub respository won't be supported. |
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
$image_data = $form_state->getUserInput()['editor_object']; |
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
$response->addCommand(new EditorDialogSave($form_state->getValues())); | |
$response->addCommand(new CloseModalDialogCommand()); |
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
public function getFile() { | |
return drupal_get_path('module', my_module) . '/js/plugins/myplugin/plugin.js'; | |
} |
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
my_module.image_dialog: | |
path: '/my_module/dialog/image/{filter_format}' | |
defaults: | |
_form: '\Drupal\my_module\Form\EditorImagePopupDialog' | |
_title: 'Upload image' | |
options: | |
_theme: ajax_base_page | |
requirements: | |
_entity_access: 'filter_format.use' |
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 ($, Drupal, CKEDITOR) { | |
var myPluginSaveCallback = function(data) { | |
var content = data.image_render; | |
insertContent(content); | |
}; | |
CKEDITOR.plugins.add('myplugin', { | |
icons: 'imagepopup', | |
hidpi: true, | |
beforeInit: function (editor) { | |
// Implementation before initializing plugin. |
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 my_module_ckeditor_plugin_info_alter(array &$plugins) { | |
$plugins[myplugin] = array( | |
'id' => myplugin, | |
'label' => t('My Plugin'), | |
'module' => my_module, | |
'class' => 'Drupal\my_module\Plugin\CKEditorPlugin\MyPlugin, | |
'provider' => my_module, | |
); | |
} |
NewerOlder