GithubHelp home page GithubHelp logo

craftcms / redactor Goto Github PK

View Code? Open in Web Editor NEW
101.0 13.0 47.0 3.98 MB

Edit rich text content in Craft CMS using Redactor by Imperavi.

Home Page: https://plugins.craftcms.com/redactor

License: MIT License

JavaScript 89.10% CSS 6.78% PHP 3.31% HTML 0.41% SCSS 0.40%
craftcms craft-plugin redactor

redactor's Introduction

Redactor icon

Redactor

This plugin adds a “Redactor” field type to Craft CMS, which provides a rich text editor powered by Redactor by Imperavi.

Requirements

This plugin requires Craft CMS 4.0 or later.

Installation

You can install this plugin from the Plugin Store or with Composer.

From the Plugin Store

Go to the Plugin Store in your project’s Control Panel and search for “Redactor”. Then click on the “Install” button in its modal window.

With Composer

Open your terminal and run the following commands:

# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require craftcms/redactor

# tell Craft to install the plugin
./craft install/plugin redactor

Configuration

Redactor Configs

You can create custom Redactor configs that will be available to your Redactor fields. They should be created as JSON files in your config/redactor/ folder.

For example, if you created a config/redactor/Standard.json file with the following content:

{
  "buttons": ["html", "format", "bold", "italic", "lists", "link", "file"],
  "plugins": ["fullscreen"]
}

…then a “Standard” option would become available within the “Redactor Config” setting on your Redactor field’s settings.

See the Redactor documentation for a list of available config options and buttons.

Craft Redactor config options

Craft addes the enforceButtonOrder config option that can be set to a list of button names in the expected order. This option should be used to address the uncontrollable button order set by Redactor when adding plugins to the configuration.

HTML Purifier Configs

Redactor fields use HTML Purifier to ensure that no malicious code makes it into its field values, to prevent XSS attacks and other vulnerabilities.

You can create custom HTML Purifier configs that will be available to your Redactor fields. They should be created as JSON files in your config/htmlpurifier/ folder.

Copy Default.json as a starting point, which is the default config that Redactor fields use if no custom HTML Purifier config is selected.

See the HTML Purifier documentation for a list of available config options.

For advanced customization, you can modify the HTMLPurifier_Config object directly via the craft\redactor\Field::EVENT_MODIFY_PURIFIER_CONFIG event.

use craft\htmlfield\events\ModifyPurifierConfigEvent;
use craft\redactor\Field;
use HTMLPurifier_Config;
use yii\base\Event;

Event::on(
    Field::class,
    Field::EVENT_MODIFY_PURIFIER_CONFIG,
    function(ModifyPurifierConfigEvent $event) {
        /** @var HTMLPurifier_Config $config */
        $config = $event->config;
        // ...
    }
);

Redactor JS Plugins

All first party Redactor JS plugins are bundled by default. To enable them, just add the plugin handle to the plugin array in your Redactor config.

{
  "plugins": ["alignment", "fullscreen"]
}

You can also supply your own Redactor plugins by saving them in your config/redactor/ folder. You can either place the plugin directly in that folder, or within a subfolder that is named after the plugin:

config/
└── redactor/
    └── plugins/
        ├── foo.js
        └── bar/
            └── bar.js

Other Craft plugins can supply additional Redactor JS plugin locations using the craft\redactor\Field::EVENT_REGISTER_PLUGIN_PATHS event.

redactor's People

Contributors

andris-sevcenko avatar angrybrad avatar arollmann avatar asociateone avatar bencroker avatar benface avatar benjamindavid avatar brandonkelly avatar carlcs avatar chris78er avatar croxton avatar dependabot[bot] avatar gijsstegehuis avatar i-just avatar johnfmorton avatar jrrdnx avatar kennethormandy avatar kringkaste avatar lindseydiloreto avatar nettum avatar olemartinavento avatar olivierbon avatar saboteur777 avatar steverowling avatar timkelty avatar tpmatthes avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redactor's Issues

Cannot get formattingAdd to apply custom formats to text

I have been trying to add some formatting specific to my website by using the "formattingAdd" option, as documented here : https://imperavi.com/redactor/docs/settings/formatting/#s-formattingadd All the other options seem to work fine.

Here is my code in the /config/redactor/Advanced.json file :

  "buttons": [
    "formatting",
    "bold",
    "italic",
    "unorderedlist",
    "orderedlist",
    "link",
    "image",
    "video"
  ],
  "plugins": [
    "source",
    "fullscreen",
    "video",
    "alignment"
  ],
  "toolbarFixed": true,
  "imagePosition": true,
  "imageFloatMargin": true,
  "imageResizable": true,
  "formattingAdd": {
    "green title": {
      "title": "Green header 1",
      "api": "module.block.format",
      "args": {
        "tag": "h1",
        "class": "coriandr-green-text",
        "type" : "toggle"
      }
    }
  }
}

The item appears in the formatting dropdown menu :
image

However, when I try to click on that button, I get the following error : Cannot read property 'toLowerCase' of undefined. Here is the stacktrace :

redactor.js:5697 Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
    at init.arrangeTag (redactor.js:5697)
    at init.format (redactor.js:5429)
    at init.clickCallback (redactor.js:2026)
    at init.toggle (redactor.js:1988)
    at init.buildClick (redactor.js:3946)
    at init.<anonymous> (redactor.js:3926)
    at HTMLAnchorElement.i (jquery.js:496)
    at HTMLAnchorElement.dispatch (jquery.js:5206)
    at HTMLAnchorElement.v.handle (jquery.js:5014)

Is this an issue with the Redactor itself, or with the Craft plugin? Or is there an issue with the format of my configuration in the JSON file?

Can't add additional Redactor plugins to Craft3 with custom config

I'm using Craft CMS 3.0.0-RC13 and Redactor 2.7 (latest versions I could pull in with Composer).

I've added 3 extra JS plugins: clips, inlinestyle and specialchars. Everything is copied (JS/CSS) to the /config/redactor/plugins folder. Names are matching. For example: /config/redactor/plugins/specialchars.js

Afterwards I've set up a custom config "extended.json" in /config/redactor:

{
  "buttons": ["formatting", "bold", "italic", "unorderedlist", "orderedlist", "link", "image", "video"],
  "plugins": ["source", "fullscreen", "video", "clips", "inlinestyle", "specialchars"],
  "toolbarFixed": true,
}

The problem is, Craft seem to recognize them (when I spell the name of one plugin false on purpose, I get an error in Craft), but I can't get them visible as buttons.

Craft character limit and counter for Redactor RTF

It would be nice to have the ability to set character limits with the counter like in plain text fields for RTF.

Currently, it's only possible to set character limit per Redactor config, that starts to being messy with few fields with different limits (with limiter plugin).

Also, Redactor counter plugin doesn't work for me at all, though even if it would work, having counted character amount is not so oblivious like having left characters counter.

ReferenceError: Redactor is not defined

I'm trying to add alignment to the redactor plugin.

According to the docs:

just place their JS file (and CSS file if there is one) in config/redactor/plugins/. Both files should have the exact same name as the plugin ID that you will be typing into the plugins array in your Redactor config JSON.

In my config/redactor/Simple.json I have:

{
	"buttons": ["bold", "italic"],
	"plugins": ["source", "alignment"],
	"toolbarFixed": true
}

I downloaded script and added it here: config/redactor/plugins/alignment.js but then I get this: Uncaught ReferenceError: Redactor is not defined at Alignment.js:54

I don't have to modify any js do I?

IE 11 Script execution issue

A client noticed that an entry (channel) page 'wasn't work right' while using IE 11.

I investigated the issue and I was able to reproduce the error using browserstack version of IE 11. I believe that redactor is causing the problem due to the use of the 'includes' method. I've attached two screen shots of the js error log.

I tested the issue by removing all redactor fields from that entry. The issue wasn't able to be reproduce at that point so I assume it it caused by redactor.

I also did a search of the craftcms/cms directory for 'includes' and the only js files that were returned were RedactorInput.js and the Velocity.js files.

My client is going to use Chrome going forward to enter content, but I wanted to enter the bug since the Craft and Redactor browser specs say they support IE 11.

screen shot 2018-05-09 at 12 44 04 pm
screen shot 2018-05-09 at 12 44 14 pm

Redactor Video plugin not functioning after install.

  • Using Craft CMS 3.0.0-RC12
  • Hosted on Arcustech
  • Using Multisite functionality
  • Installed/uninstalled multiple times using the documentation here and the plugin store. Hasn't resolved.

Copy and pasting a YouTube link in the into the box brought up after clicking the video icon results in a preview of the video being shown in the field box. Saving then checking the rich text field again shows an empty field. Checking the html in the field shows <div class="video-container"></div>.

Copy/paste the full YT embed code into the video prompt shows the following :
screen shot 2018-02-26 at 4 15 30 pm
Checking the html shows(I removed my vid ID) :

<iframe width="560" height="315" src="&lt;div class=" video-container"="">&amp;amp;lt;iframe style="width: 500px; height: 281px;" src="//www.youtube.com/embed/MYvideoID" frameborder="0" allowfullscreen&amp;amp;gt;</iframe>
<p>;controls=0&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen&gt;</p><p></p>

path/to/project/config/redactor only contains GridTitle.json Simple.json and Standard.json. Not seeing any redactor plugin directory or files.

Not sure if I just messed up the install, or if there is a bug here. Any help would be appreciated.

ImageTag config -> Inline images

Hi,

I'm trying to add an image in my paragraph with redactor, but he creates a new figure element outside the paragraph tag. Is it possible to place it in the paragraph tag? I've read on https://imperavi.com/redactor/docs/settings/images/#setting-imageTag that there should be a way to set the imageTag.
I've set this to span in my redactor config:

{
"buttons": ["formatting", "bold", "italic", "unorderedlist", "orderedlist", "link", "image"],
"plugins": ["source", "fullscreen"],
"formatting": ["p", "h1"],
"toolbarFixed": true,
"linebreaks": true,
"imageTag": "span"
}

When I add an image to the redactor field it still wraps a figure tag around it ->

<div class="redactor-layer redactor-styles redactor-layer-img-edit redactor-in" aria-labelledby="redactor-voice-0" role="presentation" id="redactor-uuid-0" contenteditable="true" spellcheck="true" dir="ltr" style="min-height: 40px;">

<p>Test</p><figure><img src="http://localhost/uploads/content/Gear.png#asset:657">​</figure>

</div>

Craft version: Craft Pro 3.0.0-RC7.1
Redactor version: 1.0.1

Browser crashes when editing a link to an entry

When I try to edit the following link which has an entry reference:

afbeelding

The browser just hangs and eventually the tab crashes (tested both in Chrome and Firefox). If there's no reference to an entry, editing the link works just fine.

This also only happens on our staging environment. In local dev the links just save fine.

Updating to 1.0.0.1 issue

Just got this when trying to update redactor to 1.0.0.1 via the CMS - running Craft 3 RC1. Any ideas?

Error: The "https://composer.craftcms.com/p/craftcms/redactor/515f8937e0d8c61b036f46e61543fe91eefb681fc88bdd6a974950aedfd4b2b6.json" file could not be downloaded (HTTP/1.1 404 Not Found)

Output: Loading composer repositories with package information
Updating dependencies

Redactor fields in secondary tabs not initialising

Craft only seems to initialise Redactor fields on the active tab when the page loads. Navigating to a different tab containing a Redactor field just reveals a generic <textarea>.

This comment looks like it might be related.

Tested with Craft 3.0.1, Redactor 1.1.0 in Safari and Chrome.

Linking from Images in Redactor Editor

We should be able to select an image and then choose insert a link to where it goes. Redactor doesn't seem to want to play like that, it just inserts the link outside of the image. For some reason, I thought this worked but a client was asking about it and then I tried it as well.

The workaround is to insert a link, pull the URL out of the link (to make sure you get the reference tag), edit the image, and paste the link in. That seems very un-Craft-like to me.

Matrix blocks are obviously the way to go with that but sometimes you just want to make a link to a thumbnail or something else. As some clients transition from TinyMCE and WordPress, this is always how we've done it.

It would be nice if this box:
screen shot 2018-05-08 at 11 51 08 am

... as well as a Url field, let you select an entry to link to as well.

screen-shot-2018-05-08-at-11 51 08-am2

I think the would save some pain.

formattingAdd

I just recently updated, and now my formatting add styles don't seem to be working. Is there a new way to do this. Here is what is in my standard.json

`{
"buttons": [
"format",
"bold",
"italic",
"deleted",
"underline",
"unorderedlist",
"orderedlist",
"link",
"image",
"horizontalrule"
],
"formatting": [
"p"
],
"formattingAdd": {
"heading3": {
"title": "Heading 3",
"args": [
"h3",
"class",
"title is-3"
]
},
"heading4": {
"title": "Heading 4",
"args": [
"h4",
"class",
"title is-3"
]
},
"heading5": {
"title": "Heading 5",
"args": [
"h5",
"class",
"title is-5"
]
},
"heading6": {
"title": "Heading 6",
"args": [
"h6",
"class",
"title is-6"
]
}
},
"plugins": [
"inlinestyle",
"imagemanager",
"beyondgrammar",
"specialchars",
"fullscreen"

],
"imagePosition": true

}`

Craft 3 App Install Breaks Site

While installing Redactor through the Craft 3 app store CP page, the installation failed and left me with a broken site.

I worked out that in my craft_info table in the DB, the version and schemaVersion had become out of sync somewhere during the failed install.

changing schemaVersion to 3.0.3.1 to match version, i then refreshed the admin CP page, Craft told me there were some DB changes to apply, i click continue, once complete, the site was back up and running again and Redactor was installed.

Image embed locking up in chrome (using Vimium extension)

When trying to embded an image into the editor when pressing 'select' or selecting a transform option, Chrome browser locks up. Page goes unresponsive and then have to force quit the window.

Using, Craft 3 and assets are on S3.

Working OK in Safari and Firefox.

Adding images and files to content field in full screen mode

I have a problem adding files or images (i think it's Craft usability issue):

image-2

fullscreen selection is very useful, as field functions menu will not be available when scrolling town in a long article page (the good solution would be to have a scroll in text content field, so user would still have functions menu)

image-1

In fullscreen mode the field scroll and functions menu are available but adding files window will open behind the fullscreen window and can't be accessed

image

cnv_r4nl0z

Uncaught TypeError: $R[s][t] is not a constructor

Hi,

first a disclaimer: I'm a first time Craft user (but a long time developer).
Today I installed Craft, running it in local Docker containers. I created my first Section (a Single), and upon defining the Entry-type realise I want richt-text, so installed this Redactor plugin (v2.1.0).

Having this Single section, with only one field 'Body' being the Redactor rich-text type. I paste in some plain text in the HTML source (to prevent automatic formatting) and save. Upon editing the entry I'm getting a javascript editor, and no Redactor menubar (the text itself renders fine, including some formatting being done (Youtube link expanded into embedded video, for example), but cannot be edited).

jquery.js:3869 Uncaught TypeError: $R[s][t] is not a constructor
    at Function.$R.create (redactor.js:1491)
    at s.<anonymous> (redactor.js:8931)
    at Dom.each (redactor.js:244)
    at s.observe (redactor.js:8919)
    at s.onautoparseobserve (redactor.js:10017)
    at App.callMessageHandler (redactor.js:2249)
    at App.broadcast (redactor.js:2268)
    at s.onstartcode (redactor.js:10668)
    at App.callMessageHandler (redactor.js:2249)
    at App.broadcast (redactor.js:2268)

Link to an entry has disappeared

Since the last update (redactor 3).

  "buttons": [
      "formatting",
      "bold",
      "italic",
      "unorderedlist",
      "orderedlist",
      "link",
      "html"
  ],

shows only the default linking option (manual).

screenshot-2018 05 01-23-16-44

Improved Image handling

Can you add improvements to how image attachments are handled? The ability to select image classes from an admin-defined list would be ideal to me for image manipulation in CSS, but if that's not practical then attaching the name of the image transform as a css class to the image would also be workable solution.

Also, the ability to change the applied transform on an image you've already added to the field would also be appreciated.

Allow customization of redactor plugins

The newest version of the Craft Redactor plugin comes with all of the Redactor plugins bundled in it, which is awesome!

But, these plugins don't give you the ability to customize with options passed from the Redactor configs. For example, the inlinestyles plugin, forces you to be locked into the styles provided (unless I'm missing something).

It would be awesome if we could pass in options from the Redactor config JSON files to override these.

Source button missing on fields with custom configuration

First of all, thanks for porting this plugin to Redactor 3! It looks like a solid update for the editor experience. The migration of existing fields and configuration files was seamless, except for one (small) thing:

The new Redactor docs and the Redactor plugin changelog explicitly state that the source option is set to true by default. However, if I use any custom configuration, the source button won’t show up in the Redactor field. It looks like this:

redactor missing html button

For testing I’ve used the custom configuration example from README:

{
    "buttons": ["format", "bold", "italic", "lists", "link", "file", "horizontalrule"],
    "plugins": ["fullscreen"]
}

If I add "source": true, Redactor just ignores it. I’ve tested this with existing and new fields on existing and new sites, all running Craft Pro 3.0.5.

Am I missing something? Maybe you can point me in the right direction.

Change language

How can I change language in custom .json config file?
I've tried to add "lang": "ru", to it and ru.js to /config/redactor/lang/ folder but no luck.
My config is:

{
    "toolbarFixed": true,
    "buttons": ["html", "formatting", "bold", "italic", "underline", "deleted", "horizontalrule",
              "unorderedlist", "orderedlist", "alignment", "indent", "outdent",
              "link", "image", "video", "table"],
    "removeEmpty": ["p","strong","em","span","a"],
    "cleanStyleOnEnter": true,
		"imageResizable": true,
		"imagePosition": true,
    "lang": "ru",
    "plugins": ["video", "table"],
    "allowedTags": ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "dd", "del", "dfn", "div", "dl", "dt", "em", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "map", "mark", "menu", "nav", "ol", "optgroup", "option", "p", "picture", "pre", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "small", "source", "span", "strong", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"]
}

Multiple issues when using widget.js plugin

  1. Embedding a Tweet using the widget.js embed block with toolbarFixed causes the widget to be clicked when trying to use tools in the toolbar while the toolbar is overlapping the widget.

  2. Using cmd + z to undo a text change visually removes any embed that has been placed. It also removes the toolbar.

Sticky toolbar not working

The sticky toolbar doesn't work, making it near-impossible to manage large blocks of content that involve having to scroll back up the page to apply formatting or insert images etc.

Links opening in a new tab to have rel="noopener" attribute

Feature Request:

When a client adds a link into a redactor field and selects the option for it to be opened in a new tab, could we please have an attribute of rel="noopener" added to the anchor tag alongside the target="_blank" attribute? There are both security and performance benefits to this which are explained here: https://jakearchibald.com/2016/performance-benefits-of-rel-noopener/

Clients won't be going into the source and adding it themselves, so it would be good to have it done by default as we have been adding these to the hardcoded achor tags around the rest of the site and this is the last area for us that it needs implementing. Thank you.

Toolbar disappears

There is a bug where the toolbar sometimes disappears.

I've found this to happen on two occasions.

  1. When you have several WYSIWYG editor fields in the same entry/post and you've edited them one by one, once I get to the third one it happens.

  2. When the WYSIWYG field is collapsed when you first open the entry/post to edit it, you uncollapse it, and the toolbar is sometimes gone.

In both instances, saving the entry (thus also reloading the page) brings the toolbar back.

Redactor plugin not found: source

New Craft 3 installation, v3.0.5.

From within the plugin store, clicked to install Redactor plugin, v 2.0.0.1.

I can add new Redactor fields but when I try to create or edit Entries, I get the following error:

Invalid Configuration – yii\base\InvalidConfigException
Redactor plugin not found: source

 in /Users/seandelaney/Sites/REMOVED/vendor/craftcms/redactor/src/Field.php at line 107
        $view->registerCssFile("{$baseUrl}/{$plugin}.css");
                    }
                    // Don't do this twice
                    self::$_registeredPlugins[$plugin] = true;
                    return;
                }
            }
        }
 
        throw new InvalidConfigException('Redactor plugin not found: '.$plugin);
    }
 
    /**
     * Returns the registered Redactor plugin paths.
     *
     * @return string[]
     */
    public static function redactorPluginPaths(): array
    {
                
2. in /Users/seandelaney/Sites/REMOVED/vendor/craftcms/redactor/src/Field.php at line 257 – craft\redactor\Field::registerRedactorPlugin('source')
        $redactorLang = $bundle->redactorLang ?? 'en';
 
        // register plugins
        $redactorConfig = $this->_getRedactorConfig();
        if (isset($redactorConfig['plugins'])) {
            foreach ($redactorConfig['plugins'] as $plugin) {
                static::registerRedactorPlugin($plugin);
            }
        }
 
        $id = $view->formatInputId($this->handle);
        $site = ($element ? $element->getSite() : Craft::$app->getSites()->getCurrentSite());
 
                
3. in /Users/seandelaney/Sites/REMOVED/vendor/twig/twig/lib/Twig/Extension/Core.php at line 1605 – craft\redactor\Field::getInputHtml(null, craft\elements\Entry)

I've not made any Redactor config changes.

Redactor 2.2 unordered list not showing bullets

Description

The proper markup is generated when viewing source, but no bullets are showing in the front-end view.

2017-02-27_11-09-54

Steps to reproduce

  1. Run Redactor 2.2
  2. Create an unordered list.
  3. Revel in the nothingness.

Additional info

  • Craft version: 2.x and 3.x
  • PHP version: n/a
  • Database driver & version: n/a
  • Plugins & versions: n/a

Empty rich text fields add `<p><br></p>`

After the latest update, my empty rich text fields are all putting code onto the page:

<p>
  <br />
</p>

This is breaking my site a little, since I'm using |length to check whether to display fields in many cases, and this nothing code does have length. 😄

Any advice?

This is the redactor config I'm using:

{
    "buttons": [
        "html",
        "formatting",
        "bold",
        "italic",
        "unorderedlist",
        "orderedlist",
        "link",
        "file"
    ],
    "plugins": [
        "fullscreen"
    ],
    "pastePlainText": true,
    "formatting": [
        "p",
        "h3",
        "h4",
        "h5"
    ]
}

Avoid unwanted `&nbsp;` characters

We're using 1.1.0 of this plugin and running in to issues with unwanted &nbsp; characters being inserted during rich text editing.

redactor-nbsp-bug

  1. Insert your cursor in between two words
  2. Press the spacebar a few times to add extra spacing / insert &nbsp; characters
  3. Remove all but the single (wanted) space by pressing the delete key
  4. Observe that a single &nbsp; character still remains

This leads to strange spacing issues on the front-end, as our editors are inadvertently doing this all over the place.

It looks like others have reported issues with this in the past, though the fix in that specific article doesn't appear to work for us. Any tips?

ArgumentCountError on entry save

Getting this error every time I save an entry with redactor field in the matrix:

Too few arguments to function craft\base\Field::isValueEmpty(), 1 passed in /home/vagrant/sites/craft/vendor/craftcms/redactor/src/Field.php on line 314 and exactly 2 expected

Stack trace:

ArgumentCountError: Too few arguments to function craft\base\Field::isValueEmpty(), 1 passed in /home/vagrant/sites/craft/vendor/craftcms/redactor/src/Field.php on line 314 and exactly 2 expected in /home/vagrant/sites/craft/vendor/craftcms/cms/src/base/Field.php:311
Stack trace:
#0 /home/vagrant/sites/craft/vendor/craftcms/redactor/src/Field.php(314): craft\base\Field->isValueEmpty('<p>The OPC is a...')
#1 /home/vagrant/sites/craft/vendor/craftcms/cms/src/base/Element.php(1037): craft\redactor\Field->isValueEmpty(Object(craft\redactor\FieldData), Object(craft\elements\MatrixBlock))
#2 /home/vagrant/sites/craft/vendor/craftcms/cms/src/base/Element.php(776): craft\base\Element->isFieldEmpty('text')
#3 [internal function]: craft\base\Element->__call('isFieldEmpty:te...', Array)
#4 /home/vagrant/sites/craft/vendor/yiisoft/yii2/validators/Validator.php(444): call_user_func(Array, Object(craft\redactor\FieldData))
#5 /home/vagrant/sites/craft/vendor/yiisoft/yii2/validators/RequiredValidator.php(71): yii\validators\Validator->isEmpty(Object(craft\redactor\FieldData))
#6 /home/vagrant/sites/craft/vendor/yiisoft/yii2/validators/Validator.php(281): yii\validators\RequiredValidator->validateValue(Object(craft\redactor\FieldData))
#7 /home/vagrant/sites/craft/vendor/yiisoft/yii2/validators/Validator.php(267): yii\validators\Validator->validateAttribute(Object(craft\elements\MatrixBlock), 'field:text')
#8 /home/vagrant/sites/craft/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(craft\elements\MatrixBlock), Array)
#9 /home/vagrant/sites/craft/vendor/craftcms/cms/src/fields/Matrix.php(527): yii\base\Model->validate()
#10 /home/vagrant/sites/craft/vendor/craftcms/cms/src/base/Element.php(1019): craft\fields\Matrix->validateBlocks(Object(craft\elements\Entry), NULL)
#11 [internal function]: craft\base\Element->validateCustomFieldAttribute('field:indexBody', Array, Object(yii\validators\InlineValidator))
#12 /home/vagrant/sites/craft/vendor/yiisoft/yii2/validators/InlineValidator.php(72): call_user_func(Array, 'field:indexBody', Array, Object(yii\validators\InlineValidator))
#13 /home/vagrant/sites/craft/vendor/yiisoft/yii2/validators/Validator.php(267): yii\validators\InlineValidator->validateAttribute(Object(craft\elements\Entry), 'field:indexBody')
#14 /home/vagrant/sites/craft/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\Validator->validateAttributes(Object(craft\elements\Entry), Array)
#15 /home/vagrant/sites/craft/vendor/craftcms/cms/src/services/Elements.php(373): yii\base\Model->validate()
#16 /home/vagrant/sites/craft/vendor/craftcms/cms/src/controllers/EntriesController.php(539): craft\services\Elements->saveElement(Object(craft\elements\Entry))
#17 [internal function]: craft\controllers\EntriesController->actionSaveEntry()
#18 /home/vagrant/sites/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#19 /home/vagrant/sites/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#20 /home/vagrant/sites/craft/vendor/craftcms/cms/src/web/Controller.php(74): yii\base\Controller->runAction('save-entry', Array)
#21 /home/vagrant/sites/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save-entry', Array)
#22 /home/vagrant/sites/craft/vendor/craftcms/cms/src/web/Application.php(237): yii\base\Module->runAction('entries/save-en...', Array)
#23 /home/vagrant/sites/craft/vendor/craftcms/cms/src/web/Application.php(445): craft\web\Application->runAction('entries/save-en...', Array)
#24 /home/vagrant/sites/craft/vendor/craftcms/cms/src/web/Application.php(221): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#25 /home/vagrant/sites/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#26 /home/vagrant/sites/craft/public/index.php(17): yii\base\Application->run()
#27 {main}

Split Matrix block button

I'd love to have a button in Matrix block longform text fields—both WYSIWYG and, if possible, textarea—that will duplicate the Matrix block while splitting the textual content before and after the cursor position between the original and new blocks. This would allow easy insertion of images, pull quotes, and the like into the middle of existing text blocks.

If you're feeling really adventurous, then perhaps instead of merely splitting a block, you could have the button directly insert a block of the user's choice into the specified position (so if you choose to insert an image block into the middle of a text block, you'd end up with: text-image-text).

Can't get source button to show up after latest update

With the update, I can't use the source plugin anymore, but I can't seem to get the source button to show up on my toolbar.

This is my current Standard.json config:

{
    "buttons": [
        "source",
        "formatting",
        "bold",
        "italic",
        "unorderedlist",
        "orderedlist",
        "link",
        "file"
    ],
    "plugins": [
        "fullscreen"
    ],
    "pastePlainText": true,
    "source": true,
    "formatting": [
        "p",
        "h3",
        "h4",
        "h5"
    ]
}

Toolbar looks like this:
screenshot-safs local-2018 05 03-21-39-32

Previous config, that worked:

{
  "buttons": ["formatting", "bold", "italic", "unorderedlist", "orderedlist", "link"],
  "plugins": ["source", "fullscreen"],
  "pastePlainText": true,
  "formatting": ["p", "h3", "h4", "h5"]
}

Is anyone else having this problem?

Missing open in new tab checkbox?

Recently updated, I can't seem to find the open link in new tab option now.

![screen shot 2018-05-02 at 1 37 37 pm](https://user-images.githubusercontent.com/33430386/39539598-1136a838-4e0e-11e8-9f5b-c4c02174d01b.png)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.