Comments (6)
One option I thought of for the full text would be to add a __toString()
method to the message entity, and leave getText()
to return the array of outputs.
from message.
Can you give an example here , I'm not sure I follow.
The toString is a nice idea :)
from message.
I could find very few uses of the default getText()
behavior in tests or in dependent contrib (message_notify). Rather, most actual usage passes in the ['text' => TRUE]
setting.
The idea here is if folks still need the string output, then the __toString()
method should suffice, and code can rely on getText()
always returning an array.
I also realize that we can remove the language parameter from getText
by adding a setLanguage
method to the interface. That would allow __toString()
to work with languages.
from message.
Rather, most actual usage passes in the ['text' => TRUE] setting.
Indeed, as far as I remember, this ['text' => TRUE]
is needed in D7 to indicate if we want to sanitzie on not the text.
my (slight) problem with the change, is that getText()
now returns an array, which is a (slight) WTF given it's name :)
There are several places where current methods return either a string or an array based on values in an options array.
I'm not sure about this?
from message.
By several, I think I just meant the two getText()
methods on the Message
and MessageType
entities.
from message.
I've continued this work to add setLanguage()
, so the __toString()
method will properly work for all languages. I've also included some token fixes here as the code was too close to the other refactoring for a separate PR.
See #60
from message.
Related Issues (20)
- Specify required core version
- Organic groups token not replaced
- Composer json references incorrect version of coder HOT 1
- message template form says 'created' even when it's not
- typo in form element attribute HOT 1
- Fix deprecations
- Notice: Undefined index: value in MessageTemplate->getText()
- Test on 8.7.x and fix deprecations
- Need ability to select zero element in MessageTemplate::getText() HOT 1
- Use case: how to send a message to all users? HOT 2
- Fix broken tests
- Consider moving development of message* modules back to drupal.org HOT 3
- Add menu item "Messages" to the "Content" menu
- MessageNotifierBase: restricts rendered fields to user/cck fields only HOT 1
- Markup Saved to Arguments for Token Replacement returns as __PHP_Incomplete_Class HOT 1
- Notice: Undefined index: format in Drupal\message\Entity\MessageTemplate->getText() (line 289 of modules/contrib/message/src/Entity/MessageTemplate.php).
- Messages do not render when used as entity reference.
- How to enter subject and body manual per message? HOT 1
- Create MessageTemplate::getTranslatedRawText()
- Add support for Devel Generate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from message.