I have set up a content type with a body field and need a summary to be generated as well as the long text. After generating some nodes I saw I wasn't getting any summary data so I took a look at the code. This line in the _text_devel_generate() function seems to be the problem:

if ($instance['widget']['type'] == 'text_textarea_with_summary' && !empty($instance['display_summary'])) {

It should be:

if ($instance['widget']['type'] == 'text_textarea_with_summary' && !empty($instance['settings]['display_summary'])) {

I have tested and this change seems to work. Will make a patch when time permits.

Comments

alfaguru’s picture

A further niggle: the summary generated is often longer than the original text. I would suggest that instead of calling devel_create_content(), something like:

devel_create_para(mt_rand(5,20));

would be better. I have patched my own code accordingly.

sc-perth’s picture

Issue summary: View changes
Issue tags: +8.x-1.0-rc1

Also affecting Devel 8.x-1.0-rc1 in that:
- Summary is full content, instead of a summary.
This causes the user to think that Drupal is broken or misconfigured until they figure out what is going on.
Then, if they want to test what things look like (one of the points of this module) they have to reconfigure Drupal to work around the issue. Specifically, they can't use the summary view style, but must use the trimmed view style.

Please create an option for specifying the approximate summary length that will be generated.

Thanks!

P.S. Above code snippets don't appear to be valid for the 8.x-1.0-rc1 release of Devel.