Open robertgarrigos opened 1 year ago
When setting the "Field for additional text" to body field, it tries to send the whole text top mastodon
Can you clarify that, please?
The text limit to send is 500: https://github.com/backdrop-contrib/mastotoot/blob/1.x-1.x/mastotoot.class.inc#L176
How did you manage to send a longer text, then?
@robertgarrigos I had a quick idea, what might be causing the length problem. But for that I'd need several infos from the node causing the problem:
Here it is:
node body:
<p>Desenes de persones han passat pel centre de Sant Feliu entre divendres i diumenge per visitar la Fira de Nadal, la Casa dels desitjos, i han participat en les diverses activitats que s’han organitzat.<br />
Un dels moments més especials, però ha estat aquest divendres amb l’encesa dels llums de Nadal dels carrers del poble, i de l’arbre instal·lat a la Plaça.<br />
Enguany, el nou govern ha apostat per fer diversos canvis pel que fa la decoració nadalenca. D’una banda s’ha prescindit per primer cop de l’arbre natural que habitualment presidia la Plaça Josep Umbert Ventura, que s’ha substituït per un de lluminós. En relació als llums dels carrers, s’han llogat a una empresa externa, amb l’objectiu de renovar-los, arribar a més punts del terme municipal, i reduir la despesa elèctrica que generaven els anteriors.<br />
Nosaltres hem sortit al carrer i hem preguntat a la gent quina opinió tenen del nou arbre i el nou enllumenat.</p>
<p>Escolteu la notícia sencera <a href="https://alacarta.onacodinenca.cat/programs/eix59/onacodinenca_podcast_12059?s=778&ref=wa">aquí.</a><br />
</p>
title: Clone of L'opinió dels codinencs sobre l'arbre de Nadal de la Plaça i el nou enllumenat dels carrers
tags: sant feliu de codines, festes de nadal
libxml version: 2.10.2
Hm, I just used the exact same body content, tags, title, and it got published without any problem to my testing instance.
I do note this odd
(=newline) in the middle (note that I have a different language set on my site than you have), but it didn't break publishing.
Your libxml version is much newer than mine, I have 2.9.14 - these two should behave the same, though.
So, still no way to reproduce.
@robertgarrigos in the meantime I've fixes an issue that may or may not be related (not when I was testing, but...).
Can you try with the latest dev?
Tried latest dev. Same error.... :-(
Hm... Do you have the devel module installed? Here's some code to run:
$node = node_load(200);// <- use your NID here!
$text_fields = field_get_items('node', $node, 'body');
$text_field = reset($text_fields);
$stripped = strip_tags($text_field['value']);
$text = text_summary($stripped, NULL, 335);
$text = html_entity_decode($text);
debug($text);
What do you get here as output?
nothing. blank output
nothing. blank output
What? Are you sure, you picked the right nid? In my example I used 200, but your node id is different, for sure.
Wait... thinking this over. Maybe error display is completely off on your site. In that case the output still gets logged. What do you find on /admin/reports/dblog re that code?
This is what I get in the dblog:
User notice:
'El Taula per 5 d\'aquest dimecres ha comptat amb Pol Cabutí de Primàries Codines, Manuela Jimena de Junts per Sant Feliu de Codines, Anna Maria Vilarrasa de Junts per Catalunya i Laia Jordana del PSC.
Podeu recuperar el programa aquí.
La propera edició del \'Taula per 5\' serà dimecres 8 de novembre a les 20 hores.
'
a eval() (línia 9 de /Users/robert/Sites/ona/modules/devel/devel.module(1184) : eval()'d code).
That's a different node, though.
However, the length is fine, the body content got shortened as desired.
How's the content for the node you posted initially? The one with the title "Clone of L'opinió dels codinencs sobre...".
Another question: do all nodes get rejected by your Mastodon instance, or does it only happen for specific nodes. If so, what's the difference? Are you in contact with your Mastoadmin?
Yes, it is a different node, but this one also triggered the error. All nodes seem to get rejected. I could contact my Mastoadmin, yes.
All nodes seem to get rejected.
With all setup variants, or only when you try to add the snippet from "body"?
I could contact my Mastoadmin, yes.
Yes, that might help. The error message just doesn't make any sense to me. Maybe it's a totally different problem and we're just wasting time here. Maybe there's really a problem with the module, that only shows up on specific instances.
Personally, I ran completely out of ideas. But I'd appreciate, if you investigate further and let us know, what the problem is/was. :pray:
With all setup variants, or only when you try to add the snippet from "body"? No, no, with only setting "Field for additional text" to "body". Otherwise, the node gets posted to mastodon.
I'll contact my mastoadmin.
When setting the "Field for additional text" to body field, it tries to send the whole text top mastodon, instead of just a teaser, which generates an error from it: too many characters.