Just performed the automated upgrade to the latest version of 7.x3.4 from 7.x3.3 and the button that i have on ckeditor doesn't appear to do anything when pressed.

I've tried clearing the cache and switching from my default Adminal theme to seven for my admin pages but it didn't make a difference.

I had set it up to work with ckeditor (using wysiwyg) and using a custom text format (not the default full html one).

I'm wondering whether its this fix https://www.drupal.org/node/2115763 thats caused the issue?

I've deleted 7.x3.4 and uploaded via ftp 7.x3.3 and its working fine

no idea whats needed to debug this, but happy to run tests if someone can point me in the right direction

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dean Clayton created an issue. See original summary.

Dean Clayton’s picture

Title: Linkit butto doesn't do anything when pressed (ck editor) » Linkit button doesn't do anything when pressed (ck editor)
tkruger’s picture

I am getting the same thing.

sdmeyers’s picture

Same issue. Received this error in browser debugging console:

TypeError: Drupal.settings.linkit.fields is undefined

Leads to line 45 of plugin.js (CkEditor):

Drupal.settings.linkit.currentInstance.profile = Drupal.settings.linkit.fields[editor.name].profile;

Downgraded back to 3.3.

anon’s picture

Are you using features or some other "import" module to handle the profiles?

mstrelan’s picture

I am getting this same error, except it only applies to the wysiwyg in paragraphs fields, when the paragraph is not loaded on initial page load, ie. it is loaded via ajax after clicking "edit". The error message I see is "Uncaught TypeError: Cannot read property 'profile' of undefined" which also leads to line 45 of plugin.js.

Dean Clayton’s picture

for me I'm not using features or any import modules. I had created the fields already and then uploaded the linkit module and edited the wysiwyg configuration to add the button into the editor.

I have created 2 profiles, though i could probably delete one as its no longer used.

I saw the issue on a basic page with 1 large text field (body).
I'm using the wysiwyg module with ckeditor. I've also noticed that i don't appear to be able to use linkit on create, only edit ( though i'm not sure whether this is related and i've only seen this on pages with multiple wysiwyg fields)

anon’s picture

Status: Active » Closed (cannot reproduce)

I get tons of issues regarding undefined methods calls.

In most cases, this is not because linkit fails, its that something before linkit fails that the bubbles up.

Please see this issue, as it seems to be the root cause for many "undefined" issues.

#2249097: CKeditor dialogue works on one node type, broken on another

I will close this for now. Please feel free to open it again if you can provide more detailed information that helps me reproduce this.

mstrelan’s picture

Version: 7.x-3.4 » 7.x-3.x-dev
Status: Closed (cannot reproduce) » Needs review
FileSize
836 bytes

Thanks @anon for responding to this. The suggestions in #2249097: CKeditor dialogue works on one node type, broken on another did not help me and my error report in #6 is reproducible. I'm guessing it is to do with something the Paragraphs module is doing, but I noticed that disabling static caching in linkit_pre_render_editor_element() fixes this for me.

If I add a call to dpm($element); I notice that the same element is processed twice by LinkIt with the same id each time. The second time the library and js_settings aren't attached to the element, because it's skipped due to the static caching.

While it may be better to fix this in other modules, would it be possible to change the way the static caching works in linkit_pre_render_editor_element()? The attached patch will cache the js_settings for an element by its id, but attach the settings to the element regardless of if it's been processed already.

@Dean Clayton perhaps you could see if this resolves your issue too?

AmiGator’s picture

nothing above does not work. error is:
Uncaught TypeError: Cannot read property 'filtered_html' of undefinededitor.addCommand.exec @ /sites/all/modules/linkit/editors/ckeditor/plugin.js?t=F7J9:57exec @ ckeditor.js:182CKEDITOR.tools.extend.execCommand @ ckeditor.js:250CKEDITOR.tools.extend.click @ ckeditor.js:667d.execute @ ckeditor.js:668(anonymous function) @ ckeditor.js:669(anonymous function) @ ckeditor.js:29CKEDITOR.tools.callFunction @ ckeditor.js:29onclick @ edit:1

Dr Jason Guo’s picture

In response to #6,

This could be the result of lacking a Linkit profile when setting up the Paragraphs field.

Maybe an easier fix is to define and attach a Linkit profile to the Paragraphs field after the field is defined? Please try the following:

  • Admin > Configuration > Linkit Profiles
  • Clone the existing WYSIWYG profile and name it something like "WYSIWYG-PARAGRAPH"
  • Be sure to choose "This profile will be used with: Fields"
  • Under Insert Methods > Insert plugin > choose "Raw URL" and save
  • Admin > Structure > Paragraph Bundles
  • edit bundle > Manage fields
  • Edit the fields you created under Paragraphs bundle, tick "Enable Linkit for this field" and pick the above created profile "WYSIWYG-PARAGRAPH" from the dropdown
  • Save
mstrelan’s picture

Status: Needs review » Closed (duplicate)

While I maintain that this was a separate issue, and was not resolvable by increasing max_input_vars, it has since been resolved in 7.x-3.5 by #2249097-31: CKeditor dialogue works on one node type, broken on another.

mstrelan’s picture

Status: Closed (duplicate) » Needs review
FileSize
818 bytes

Sorry, I'm opening this back up as I've experienced it again. It's difficult to reproduce but the patch is suitable under "normal" situations so I still believe it should be considered.

mstrelan’s picture

Ryan Senese’s picture

I can reproduce this issue, but I'm not sure if it's because of the other module I'm using or not (Page Preview). When the preview iframe is open, the following error is logged into the console when clicking on LinkIt in the WYSIWYG:
Uncaught TypeError: Cannot read property 'filtered_html' of undefined (Filtered_html being the default text format of my Drupal site)

ja09’s picture

I can confirm this on a fresh installation using ckeditor 7.x-1.17 and linkit 7.x-3.5. Brand new install and those are the only two additional modules installed.

Console errors:
Uncaught TypeError: Cannot read property 'filtered_html' of undefined
Uncaught TypeError: Cannot read property 'full_html' of undefined

Tried the patch on #13 above, and tried the dev module. No luck with either.

ja09’s picture

Priority: Normal » Major
Status: Needs review » Needs work
ja09’s picture

Priority: Major » Normal
Status: Needs work » Needs review

Nevermind, this seems to be a documentation issue more than anything. Didn't realize a Linkit profile had to be configured. Don't remember that being required a couple years ago. Sorry about that.

For simplicity, I think it would be very helpful to update the description that appears on the ckeditor screen...

Change line 1025 of linkit.module to something like this:

      // Description of plugin - it would appear in plugins management of profile settings
      'desc' => t('Support for Linkit module (Requires proper configuration of a <a href="/admin/config/content/linkit">Linkit Profile</a>)'),
anon’s picture

I can't commit any patches until I have a tested this myself, and from the information given it is not clear how to reproduce.

Also, I suspect that there is not only one other module causing this.
Can we try to do a list of modules?

aken.niels@gmail.com’s picture

I can confirm that patch in #9 fixes my issues too in previewed Paragraphs.

anon’s picture

Status: Needs review » Needs work
james.cartledge’s picture

I can reproduce the issue with Page Preview as described in #15, and confirm the patch at #9 resolves the issue.

anon’s picture

Status: Needs work » Needs review
FileSize
3.36 KB

It seems like the static cache is causing more trouble then good. Also, the linkit_pre_render_editor_element method is quite "lite" to run.

I suggest removing the static cache.

Tests this patch.

lor’s picture

#23 not working for me:

patch -p1 --dry-run < ../../patch/linkit_button_doesn_t-2550845-23.patch
patching file linkit.module
Hunk #1 FAILED at 1062.

Linkit Version: 7.x-3.5

#9 is working great.

Thank you for the job!

anon’s picture

The test bot can patch it. Run it with the lastes dev.

hondo522’s picture

I'm still seeing the error for max_input_vars. This is causing the the linkit editor to get stuck rendering without any real JS error. We're using the latest dev version of linkit with this patch:

https://www.drupal.org/files/issues/linkit_button_doesn_t-2550845-23.patch

Here's the error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /linkit/dashboard/bos_settings_linkit_editor
StatusText: OK
eelkeblok’s picture

Status: Needs review » Reviewed & tested by the community

@hondo522 Is this an issue that is introduced with this patch? It doesn't sound related.

I've had a look at the patch. It might appear that it makes many changes, but all it really does is remove one level of indentation because the check for the static variable is removed, plus two very minor changes (one comment is made to fit in 80 characters, and the sequence of the imce check is made a bit more logical). Also, it seems to actually do what it says on the tin, it fixed this problem we were having with the editor in a paragraph field. RTBC for me. hondo522, please feel free to set it back to needs work if you can clearify a bit more how you find that the problem you have is caused by this.

  • anon committed 31ae929 on 7.x-3.x
    Issue #2550845 by mstrelan, anon, Dean Clayton, ja09: Linkit button...
anon’s picture

Status: Reviewed & tested by the community » Fixed

Committed patch in #23

Status: Fixed » Closed (fixed)

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

s427’s picture

I can confirm that patch #9 did it for me. Thanks!

To clarify, my problem was: on a wysiwyg field (ckeditor) with the paragraph module, and the paragraph field configured to be on "preview" mode by default (when editing the node). When opening the paragraph field to edit its content and using the linkit button, nothing happened and the console output the "Drupal.settings.linkit.formats is undefined" error.
This did not happen if the paragraph field was open by default (instead of preview).

RAWDESK’s picture

Our hosting partner resolved it by increasing the max_input_vars to 5000.
No other option addressed above seemed to be working.

RAWDESK’s picture

Applying patch #23 (by installing 7.x-3.5+25-dev) eventually solved it, since for larger Paragraphs wrapped textarea pages the remedy by increasing the max_input_vars didn't work in all cases.

Any chance this version gets released to 7.x-3.6 one of these days ?