Publisher does not support the Fluid field type. Please do not contact asking when support will be available.
If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.
Ticket: Publisher hooks, for the webservice module
Status | Resolved |
Add-on / Version | Publisher n/a |
Severity | |
EE Version | n/a/ |
Rein
Nov 26, 2018Hi Brain,
How are you doing?
I have currently a ticket request for integrating Publisher better within the webservice module. Im the Webservice Module i use the native Entry models to search an entry. When publisher is installed and you search on a translated entry, it will look with the native modules in the channel_data table and not in your tables. Is it possible to search an entry with a translated phrase?
For example, we have a site with 2 languages. (EN and NL) The default language is EN and we have one entry translated to NL. is it possible to do something like this.
ee(‘Model’)->model(‘ChannelEntry’)->filter(‘field_id_3’, ‘welkom’). Where you would normally do ee(‘Model’)->model(‘ChannelEntry’)->filter(‘field_id_3’, ‘welcome’)
let me know.
Best,
Rein
BoldMinded (Brian)
You can try using ee(‘Model’)->model(‘publisher:EntryTranslation’), but I personally haven’t tested it with the ->filter() method.
Rein
Comment has been marked private.
BoldMinded (Brian)
You can download the free trial.
Rein
Ofcourse…
Is it possible to create a relation from “publisher:EntryTranslation” to “ee:ChannelEntry”?
Im using your model as a with ‘->with(“publisher:EntryTranslation”)’ in my code and because there is no relation from “publisher:EntryTranslation” to “ee:ChannelEntry”.
The following error popups:
Undefined index: publisher:EntryTranslation ee/EllisLab/ExpressionEngine/Service/Model/RelationGraph.php, line 64
Is it possible for you to create such relation?
Let me know.
BoldMinded (Brian)
Rein, I don’t think I’ll be prioritizing such a change b/c there are other more demanding things that need my attention, but if you’d like to submit a diff I’d be happy to take a look at it and potentially integrate it.
BoldMinded (Brian)
I’m not sure you’ll be able to easily create a relationship between the two without manipulating the database. EntryTranslation uses a composite key, which EE’s native models have literally no concept of (which is a core design issue if you ask me), which is why I had to overload the save() function in EntryTranslation. Because of this using EE’s $_relationships property on the model may not work. You can try, but I have a feeling it won’t.
BoldMinded (Brian)
Rein, not sure if you saw my latest tweet, but I’m working on Publisher 3, which will include a migration of the publisher_data table to separate tables for each field, so the underlying data model will be very similar to other EE fields. I still think the lack of composite key support in EE’s models means that I doubt I can fully support the ->filter() method. It may be easier for me to add an array option to the Service/Entry/Entry->find() to do the filtering.
Rein
Hi Brian,
Thanks, thats looks promising.
However, currently there is a bug inside the model service when using ‘->with()’
https://github.com/ExpressionEngine/ExpressionEngine/issues/31
You can close this issue as the bug has nothing to deal with publisher 😉
Best, Rein