Hello,

In my installation, the whole message text field is missing when I go to "add new message type". What could be the reason?

Thank you and best regards.

Comments

RoySegall’s picture

Do you have the locale module enable? and if so did you enable it after creating messages?

Nicolino77’s picture

Thanks for responding! It is missing with and without Locale module being enabled. Do you have another idea? :-)
Thanks a lot!

RoySegall’s picture

Can you reproduce this on a clean installation? can you export somehow the message(create a feature) or supply a DB dump.

Andre-B’s picture

Status: Active » Postponed (maintainer needs more info)

this could also be caused by missing text formats.

Nicolino77’s picture

Thanks to you for replying. I made a fresh installation and there it works. Apparently, one of my many modules caused the error but I don't know its name. Hm...

pinkonomy’s picture

@Nicolino77:I have the same issue,how did you finally solve this?

pinkonomy’s picture

Any news on this issue?

RoySegall’s picture

I dug a little bit in the dump in this is what i found: for some reason the field don't appear in the UI but the table of the field(field_data_message_text) is exists in the database. Don't know how this happened but from what i can see is you don't have a lot of content in your and i can think of to ways to solved this:
1. Export all the content types and views and fields to features and re-install your drupal site. If after a clean installation you don't have the fields again then some of the modules is messing this up and it's up to you to find out.
2. If you are not a developer don't do this: delete the tables field_data_message_text, field_revision_message_text and delete the message_text from the field config and run the code in the function message_install() which i think would a bit hard if you are not a programmer.

This are the option i can think to solve this issue.

pinkonomy’s picture

Thanks Roy for the help,I will try to find a solution based on your instructions.Thanks again!

pinkonomy’s picture

One more thing:I enabled the Message example module,created some content and visited the Message example view.The view is empty,it shows only a bullet view without content.So I think the logging is not recorded.
Just in case this make more sense.

RoySegall’s picture

Nothing from iv'e seen in this dump make sense: the field exists - that's why i deleted the fields and run the install function all over again but the it's not attached to the message form.

This is very strange issue.

pinkonomy’s picture

@Nicolino77 :Could you write here the modules you are using so as to compare with the modules I am using to compare and see which modules are common ?Probably a module is causing this issue.
thanks

Andre-B’s picture

also consider copying the languages from "Language none" to the newly added one from your local on /admin/config/system/message/text-copy

thirdender’s picture

I just ran into this problem as well. Ultimately what I ended up doing was disabling almost all the modules on the site, disabling the Message module, uninstalling the Message module (admin/modules/uninstall), and then enabling the Message module again. When I did this, the Message text field appeared in the UI.

For future readers finding this issue, try this first: Disable, then Uninstall the Message module, then re-Enable the module through the UI (not drush). I'm curious if this fixes any issues, or if there's still a conflict with another module that I'd previously enabled.

nooysters’s picture

I uninstalled and re-enabled without drush the and the message field showed up. I suspect there was a problem while using drush as there was an error after drush en message.

kevster’s picture

Thx guys - I had this issue and couldnt figure out whats going on - so uninstalled all relevant modules - message, message_notify, commerce_message and commerce_notification and then enabled again and my message text field has come back.

I had an issue with commerce_notification as it doesnt seem to uninstall cleanly leaving tables in place which then means errors when re-installing - had to manually delete two tables

Electric Doorknob’s picture

Having just encountered this issue myself while developing a new module that uses Message, I'll describe the root cause of this issue and why reinstalling modules can resolve it.

Message uses fields on message_type_category bundles as "templates" for message_type entities. The fields are cloned onto new message types for the Add Message Type page/form. Any field attached to the message_type_category specified in the select box on that form will appear.

So, while the field_data_message_text tables may exist, the key component is the attachment of that field to the appropriate message_type_category; look in field_config_instance.

If that field has become detached from the Message Type Category for some reason (after exporting and importing message entities via features, for instance) identify the field attachment code in the appropriate module's .install file. If you can execute it via drush or devel/php you can avoid dealing with reinstalling modules and/or exporting and importing data. See this discussion: https://www.drupal.org/project/message/issues/2045953

For module developers implementing new Message Type Categories with hook_default_message_type_category() from Message, know that you must also attach an instance of message_text to the new bundle the hook creates (or provide an alternate field for the message_text; you'll know what you're doing if you need this). See Commerce Message for a good example of this. If you don't, you'll still be able to create Message Types with the Add Message Type form, but any messages of that type will throw "EntityMetadataWrapperException: Unknown data property message_text" errors upon rendering.

There, I think I've put enough SEO-worthy keywords into this comment to help Googlers. Enjoy!

bluegeek9’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)