Message Form on messages page doesn't appear.
Opened this issue · 4 comments
There is one different parameter I found in template.collection.list.js file in the line #16 there is something like this line of code
var template_entity_type = $(this).attr('entity_type');
In this line it is searching one parameter "entity_type"
But in the message page configuration on the event the parameter's name is just "type"
So the message form doesn't appear if you change the parameter type instead entity_type, it works.
Cannot reproduce any problems with the Template Collection List element in both RNG events and Couirer system.
Which page are you viewing this?
Hey @dpi,
While we are trying to edit an email inside "Messages" tab (Path: /node/{NID}/event/messages),
The "Email" link looks like this: <a href="/courier/collection/2/template/courier_email?destination=/node/6/event/messages" type="courier_email" class="item active">Email</a>
We can notice anchor's "href" attribute is pointing to "/courier/collection/2/template/courier_email" which is good, however when we click there, it's trying to go to: "courier/collection/2/template/undefined?_wrapper_format=drupal_ajax" but last parameter is not defined: "undefined".
After debugged we found that "template.collection.list.js" at https://github.com/dpi/courier/blob/8.x-1.x/js/template.collection.list.js#L16 is trying to retrieve "entity_type" attribute:
var template_entity_type = $(this).attr('entity_type');
But it doesn't exist, however "type" is available: type="courier_email"
, therefore we switched to:
var template_entity_type = $(this).attr('type');
Can you switch your theme to Bartik and see if you still have this problem?
I see the attribute being assigned here: https://github.com/dpi/courier/blob/8.x-1.x/src/Element/TemplateCollectionList.php#L148 I'm not entirely sure what is happening.
I switched the theme to Bartik and the parameter is still as "type" on the html.
<a href="/courier/collection/5/template/courier_email?destination=/node/6/event/messages" type="courier_email" class="item active blue">Email</a>
"type="courier_email"
var template_entity_type = $(this).attr('entity_type');
This line is looking for entity_type not type.