I'm trying to insert a token with the text interface. When I press insert the edit page i reloaded and nothing is inserted.
Even more: when the "insert token" is enable for a particular field the node cannot be saved. Pressing the save button, in the "edit node", only refresh the page.
Another unusual behaviour: two insert-token drop-down menu are showed behind the field with the insert-token enabled.

The field is of long-text type.

CommentFileSizeAuthor
#9 double_tokens.jpg87.68 KBdimon00
#7 doubletokens.png33.43 KBdimon00
#3 doubledropdown.png31.34 KBdimon00

Comments

attiks’s picture

Assigned: Unassigned » jelle_s
jelle_s’s picture

Status: Active » Postponed (maintainer needs more info)

I could reproduce the first behaviour, but failed to reproduce the second (multiple drop-downs). The first should be fixed in the latest dev now. Could you post the exact steps I need to take to get the multiple drop-downs?

dimon00’s picture

StatusFileSize
new31.34 KB

In "Content types" I edit my node type.
In "manage field" -> edit for my custom field. I tick "Use Token Insert for this field " then save.
Now I open of of my node of that type and click on "edit".
The screenshot shows the double drop-down.

jelle_s’s picture

Have you tried using the latest dev version? I'm stunned by this as I've never seen this behaviour before with token insert

dimon00’s picture

I fear I'm using the last 7.x-2.x-dev.

Any log file I can look into?
Any test I can perform?

jelle_s’s picture

Did you run update.php (we changed some variable names in the database recently)? But I can hardly imagine that would be the problem.
Ok, so you enabled the module and didn't change any settings for token insert right?
Do you have any other modules enabled that might interfere with our javascript or a module that provides some extra tokens?
The only other explanation I can think of is that token_insert_text_combobox is called twice for that form element.
Could you do a watchdog or something in that function (token_insert_text.module line +/- 65) to check if this function is called with the same element twice?

dimon00’s picture

StatusFileSize
new33.43 KB

From what I can see, at some point, something has duplicated my tokens.
For every field I have two tokens in the form:
field-my-field
field_my_field
New field I'm adding now doesn't seem to be duplicated.

Any idea on how to clear the situation?

jelle_s’s picture

Could you go to admin/help/token and see if they appear twice there too?
Where is this screenshot taken from? I do not recognize the page

dimon00’s picture

StatusFileSize
new87.68 KB

The screenshot above is taken from panels (inserting content in a panel).

Here the screenshot from help.

jelle_s’s picture

I have no clue why the tokens are listed twice. But I'm not sure if this is a token insert problem. However this shouldn't/couldn't be the reason the token insert form is shown twice per field. Could you do a watchdog or something in token_insert_text_combobox (token_insert_text.module line +/- 65) to check if this function is called with the same element twice? Could you also double check the token insert version? I seem to remember we had this problem in the 1.x branch. So if you could check if you have token_insert-2.x-dev?

jelle_s’s picture

Title: Unable to insert any token » Token insert form displayed twice per field

Changed the title for clarity

jelle_s’s picture

Hi,

Could you try the latest dev version (in 12 hours from now). I took a good look at the code and according to the code it would have been possible that the form was added twice on fields with text format selection (although it didn't happen to me somehow). Don't forget to clear your cache (a couple of times) after you've downloaded it. I really hope this fixes the problem :-)

dimon00’s picture

No problem.
I'm going to test your new release tomorrow.

However I'm now worried about those duplicated tokens... :(
If you get any ideas about this other issue make me know. ;)

dimon00’s picture

I have tested the new dev version and the insert form shows only once.
unfortunately the save problem is still there.
i cannot save a node if the insert token is active.

jelle_s’s picture

That's strange,
everything works just fine here.

What are your basic settings? (field name, field type, token insert per role or not, ...)

dimon00’s picture

Token, and token insert UI enabled.
Permission to use these modules only to administrator.

The filed I'm testing on:
Label: Link iframe
Name: field_iframelink
Field: Long text
widget: Text area (multiple rows)
text format is "tokens"

I set "Use Token Insert for this field" and then modify a node containing this kind of field.

The template of my node type should be overridden using panels to change the display layout.

jelle_s’s picture

I have tested the new dev version and the insert form shows only once.
unfortunately the save problem is still there.
i cannot save a node if the insert token is active.

So, does this mean the token insert functionality itself works, but you just can't save the node?
do you get any errors (javascript, php, ...)?

dimon00’s picture

Correct.
The function works: the token is inserted in my field.
But when I try to save, the edit page is just reloaded without any error.

jelle_s’s picture

That's very strange behaviour... and when you disable token_insert_text (only this submodule) you don't have this behaviour? or do you need to disable both token_insert and token_insert_text? (just trying to narrow things down)

dimon00’s picture

Sorry. I'm a bit confused by your question.
I have 3 modules: Token insert (text), Token insert (wysiwyg), Token insert UI.

Token insert (wysiwyg) is always disabled.
If I enable "token insert UI" I don't see any option to enable token insert in my field.
So I believe I need at least Token insert (text). With this module enabled (and only this one) I have the issue.

jelle_s’s picture

Oh yes, my fault.

Token Insert UI is what you would call the "Main module" required by both Token Insert (text) and Token Insert (wysiwyg).

From your explanation this is a Token Insert (text) issue I think. Although I'm not sure why, normally we just add elements to the form, without changing any submit functionality... I'll have a look into it.

jelle_s’s picture

from #16:

The template of my node type should be overridden using panels to change the display layout.

Could you disable panels or go to the "normal" node form and see if it works there?

dimon00’s picture

For a not-panels node the behaviour is different.
When I click "insert" the node is automatically saved.
No token is added in the field.

jelle_s’s picture

uh... ok, do you have any JS errors there? Can you give me some kind of access to both forms so I can test for myself and see what happens?

dimon00’s picture

I can give you access to the development site of this.

I'm gonna contact you privately with a temporary account if you it is ok for you.

jelle_s’s picture

yes I think that would help. I will try my best to solve this issue

dimon00’s picture

Have you received the account?

jelle_s’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

setting this to cannot reproduce since you've solved it differently and I can't seem to reproduce this :-)