The most common use case body field in drupal is long text and summary, with widget Text area with a summary. By default, there is no linkit enable option at admin/structure/types/manage/MyContentType/fields/body

Comments

Drupa1ish’s picture

Status: Active » Closed (fixed)
StatusFileSize
new676 bytes
askibinski’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review

I think this patch got lost somewhere?
It's not available in 3.1 which is 6 months newer then this patch.

askibinski’s picture

Also:
When using a summary field, linkit will throw a js "profile not found" error:
#2115763: Linkit editor button errors out after switching WYSIWYG text format

This is caused by the summary field which is a dynamic element which is part of the textearea element but does need its own id:

...
function linkit_pre_render_editor_element($element) { 
...
    if (isset($element['summary'])) {
      // this is a textarea with summary field which also needs the profile
      // for the extra summary field  which can be activated.
      $field_id = $element['#id'] . '-summary';
      $field_js_summary = array(
        'data' => array(
          'linkit' => array(
            'fields' => array(
              $field_id => array(
                'profile' => $profile->name,
              ),
            ),
          ),
        ),
        'type' => 'setting',
      );
    } 

  ...

    if (isset($field_js_summary)) {
      $element['#attached']['js'][] = $field_js_summary;
    }
askibinski’s picture

double post (drupal.org was down)

askibinski’s picture

double post (drupal.org was down)

  • anon committed fb6229e on 7.x-3.x
    Fixed #1912780 by EuroDomenii - Enable linkit for Long text and summary...
anon’s picture

Status: Needs review » Fixed

Pushed the patch so the "search" button will appear on Long text and summary fields.

The other issue will be addressed in the other ticket.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

askibinski’s picture

Category: Feature request » Bug report
Status: Closed (fixed) » Needs review
StatusFileSize
new689 bytes

Hi anon,

Linkit 3.3 still gives the JS error for summary field, because it lacks the js setting as written in #3.

The other ticket you refer to (#2115763) is not the same problem. I've made a new patch and improved on my patch in #3 which will remove the JS error when you click on the linkit icon in a summary field.

The last submitted patch, 1: linkit_text_with_summary-1912780.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 9: linkit_text_with_summary-1912780-2.patch, failed testing.

Status: Needs work » Needs review
Daemon_Byte’s picture

Status: Needs review » Reviewed & tested by the community

solves the problem for me.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: linkit_text_with_summary-1912780-2.patch, failed testing.

anon’s picture

Status: Needs work » Needs review

This issue seems to be fixed by #2115763: Linkit editor button errors out after switching WYSIWYG text format

Can someone else confirm this?

anon’s picture

Status: Needs review » Closed (fixed)