Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542
This commit is contained in:
parent
3b2511d96d
commit
81ccda77eb
2155 changed files with 54307 additions and 46870 deletions
|
@ -11,7 +11,7 @@ use Drupal\Core\Field\FieldDefinitionInterface;
|
|||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Render\Element;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\Component\Utility\NestedArray;
|
||||
use Drupal\Core\StringTranslation\TranslationWrapper;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\filter\FilterFormatInterface;
|
||||
use Drupal\filter\Plugin\FilterInterface;
|
||||
|
@ -47,8 +47,8 @@ function editor_help($route_name, RouteMatchInterface $route_match) {
|
|||
* of text editors.
|
||||
*/
|
||||
function editor_menu_links_discovered_alter(array &$links) {
|
||||
$links['filter.admin_overview']['title'] = 'Text formats and editors';
|
||||
$links['filter.admin_overview']['description'] = 'Configure how user-contributed content is filtered and formatted, as well as the text editor user interface (WYSIWYGs or toolbars).';
|
||||
$links['filter.admin_overview']['title'] = new TranslationWrapper('Text formats and editors');
|
||||
$links['filter.admin_overview']['description'] = new TranslationWrapper('Configure how user-contributed content is filtered and formatted, as well as the text editor user interface (WYSIWYGs or toolbars).');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -48,7 +48,7 @@ class EditorController extends ControllerBase {
|
|||
// Direct text editing is only supported for single-valued fields.
|
||||
$field = $entity->getTranslation($langcode)->$field_name;
|
||||
$editable_text = check_markup($field->value, $field->format, $langcode, array(FilterInterface::TYPE_TRANSFORM_REVERSIBLE, FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE));
|
||||
$response->addCommand(new GetUntransformedTextCommand($editable_text));
|
||||
$response->addCommand(new GetUntransformedTextCommand((string) $editable_text));
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
|
|
@ -15,12 +15,40 @@ use Drupal\Core\Ajax\AjaxResponse;
|
|||
use Drupal\Core\Ajax\HtmlCommand;
|
||||
use Drupal\editor\Ajax\EditorDialogSave;
|
||||
use Drupal\Core\Ajax\CloseModalDialogCommand;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\Core\Entity\EntityStorageInterface;
|
||||
|
||||
/**
|
||||
* Provides an image dialog for text editors.
|
||||
*/
|
||||
class EditorImageDialog extends FormBase {
|
||||
|
||||
/**
|
||||
* The file storage service.
|
||||
*
|
||||
* @var \Drupal\Core\Entity\EntityStorageInterface
|
||||
*/
|
||||
protected $fileStorage;
|
||||
|
||||
/**
|
||||
* Constructs a form object for image dialog.
|
||||
*
|
||||
* @param \Drupal\Core\Entity\EntityStorageInterface $file_storage
|
||||
* The file storage service.
|
||||
*/
|
||||
public function __construct(EntityStorageInterface $file_storage) {
|
||||
$this->fileStorage = $file_storage;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('entity.manager')->getStorage('file')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -208,7 +236,7 @@ class EditorImageDialog extends FormBase {
|
|||
// attributes and set data-entity-type to 'file'.
|
||||
$fid = $form_state->getValue(array('fid', 0));
|
||||
if (!empty($fid)) {
|
||||
$file = file_load($fid);
|
||||
$file = $this->fileStorage->load($fid);
|
||||
$file_url = file_create_url($file->getFileUri());
|
||||
// Transform absolute image URLs to relative image URLs: prevent problems
|
||||
// on multisite set-ups and prevent mixed content errors.
|
||||
|
|
Reference in a new issue