Yes, this should work.
You could check for issues in /admin/reports/status or /admin/config/media/file-system
Also, you can check if making directories in private dir is possible, something like
$file_system->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY);
Maybe you hit issues with openbasedir (note here: https://www.drupal.org/docs/8/core/modules/file/overview → ).
Maybe you could check if dir is created before and after enabling activitypub on one account with:
ls ../private/activitypub/
ls ../private/activitypub/keys
Maybe you could try to create the directory before enabling activitypub account on user profile.
With MR applied. It can work with this template:
https://git.drupalcode.org/project/activitypub/-/snippets/238
Let's see if you mean this. just a few notes here:
Instead of creating a dedicated viewBuilder for activity entity, I used the hook https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21... . This could help us as in having to maintain it. I used the new oop hook from 11 ( https://www.drupal.org/node/3442349 → ) as doing this also allows me to clean copy the buildMicrosubItem method (instead of creating a new service). The microsubitem is attached as #microsubitem in the entity render array.
Also note that Controller is moved to an extended of EntityViewController, to reuse some of its parts and easier create the entity render array.
The template part is not implemented yet and it outs the same as it was done (markup=> "Activity $id") as i'm out of time and getting too tired of nap time developing :)
With all this changes, at least one can create templates in theme side to show nice timelines.
Just dropping the simple rendering of entity (with payload) as node (in 10.5) does.
I have all the information we need to fork the plugin, buuut I think it is too much overhead, at the end it is just one line to modify(to tweak a regexp), so it will mean low-cost for us to just patch it...(rather than maintain a whole ckeditor plugin...).
If at some point we need more then we can think about it. Also the modified ckeditor plugin will be already built in our module so nobody will need to recompile.
I tried to escape and it will escape the wildcards... because we need to look for:
https://{$domain}%/{$username}%
Also, when wildcards are there we end up with something like "%https://{$domain}%/{$username}%", leading to something different to what it is looked for.
Yes, they do locally:
vendor/bin/phpunit --debug web/modules/contrib/activitypub/tests/src/Functional/WebfingerMultilanguageSiteTest.php
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.
Testing Drupal\Tests\activitypub\Functional\WebfingerMultilanguageSiteTest
Test 'Drupal\Tests\activitypub\Functional\WebfingerMultilanguageSiteTest::testWebfingerResponse with data set #0 (array('en', '', 'es'), 'eo')' started
Test 'Drupal\Tests\activitypub\Functional\WebfingerMultilanguageSiteTest::testWebfingerResponse with data set #0 (array('en', '', 'es'), 'eo')' ended
Time: 01:20.327, Memory: 18.45 MB
OK (1 test, 22 assertions)
So it should pass when there is a new webfinger version release.
I made some progress here, this covers mentions of actors and tags creation in text in a simple way with the help of mf2. Maybe the original issue description covers a lot of things that could lead to a never-end issue. Maybe we could offer just actor and tag by now... Anyway, by now I planned only these microformats, but as mf2 is used, and two kind of mentions are there, extending to new microformats detected by mf2 can be done at some point.
Also, sorry for this, by now I will not publish the new module or the PR as there are minor points that need to be completed (tests and integration to main module), I'll do this when I find some projects to make the development sustainable...
This is how I planned:
The new module will add activitypub mentions to ckeditor5 text editors, if configured as it should you could get a list of actors or tags proposals when a marker (@ for actors, # for tags) and a pattern is entered (@abc@def.xyz
for actors, #abc for tags).
When there's an actor mention, it will feed the "to" field if the actor is not in user follower collection, and so on will be sent to remote actor's inbox.
When there's a tag mention, it will create the tag if it doesn't exist and will add the tag to the taxonomy field.
Configuration
It will need to enable the activitypub mentions, actors and/or tags, in the settings of the desired editor in /admin/config/content/formats.
For actors, proposals will create a list from following and followers that will appear after 2 characters (number configurable in editor settings). If there are no candidates when the pattern @aa@bb.cc is there, an autocomplete proposal will also appear to automatically fill the necessary link properties to be treated as an activitypub mention and so on be able to send afterward to pertinent actor inbox.
For tags autocompletion the vocabulary must be specified, take note that to be able to create a tag in the vocabulary when mentioning a tag, this will be done in editor settings. Also, a taxonomy term reference field using the same vocabulary must exist in the entity.
For both actor and tags may be configured the number of proposals (default to 10).
Additionally, if one needs to alter the actors or tags autocomplete proposals, a new two alter hooks could be used, explained in ckeditor5_activitypub.api.php.
Using in decoupled environments
Although the new module will depend on ckeditor5 config, the behavior can be cloned in other frontends, as the logic happens in presave (of the content entity and the activitypub_activity entity). So, theoretically, but not tested... One can use the Ajax controller route
to obtain the list of autocomplete proposals, and use the same downcast/upcast logics. Taking a look at new ckeditor plugin code will help about what parameters must be there to cast an HTML element with attributes to actor/tag mention. Also, how mentions coming from autocomplete can take properties from there to an HTML element with attributes.
To workaround this block I bumped my expired feature request in a new one https://github.com/ckeditor/ckeditor5/issues/18370 , Please re vote there...
and also made a PR in github: https://github.com/ckeditor/ckeditor5/pull/18371
I made some tests locally and mentions looks fine ;)
A little late, but for reference. By now, Contact form uses the form mode instead of the view mode. So no way to use layout builder if not getting in self-made controller, or done by a contributed module. For more information, check the source of
https://git.drupalcode.org/project/drupal/-/tree/11.x/core/modules/conta...
(patch will not apply, must be placed in /components/dropdown-menu/ ... sorry)
with this patch if item title is '-' and url is it will be converted to hr
I was thinking about it too since matrix conversation, and while I was trying to workaround some issues when cron was not able to properly run because other module fault... I was thinking on how moebius implement fibers, also how nextcloud is doing with some rust microservices, or how symfony mailer offers pluggable transports. So, are you planning to allow backend queue manager as plugin or is too much by now?
Forgive it, I was using a the version 4.1.4 . it's already fixed in https://git.drupalcode.org/project/paragraph_blocks/-/commit/069a18476bf... . I think it may be closed :) thank's
We have encountered the same situation, it happened whenever a paragraph is deleted in entity form. And after this, trying to edit the display layout.
Are you able to check if private files are properly configured?
These files that are not found are not related to activitypub specification, so they didn't suppose a problem, normally are looked up by mastodon as they are specified in its api ( https://docs.joinmastodon.org/methods/instance/ ).
The first thing to look for is if webfinger lookup is fine. You could try it manually all the flow, webfingering => actor/person => and after it outboxes. Also you could look in server access.log.
It is known that may be issues with languages. Do you use translations in your site?
These files that are not found are not related to activitypub specification, so they didn't suppose a problem, normally are looked up by mastodon as they are specified in its api ( https://docs.joinmastodon.org/methods/instance/ ).
The first thing to look for is if webfinger lookup is fine. You could try it manually all the flow, webfingering => actor/person => and after it outboxes. Also you could look in server access.log.
It is known that may be issues with languages. Do you use translations in your site?
Thank's tim. Just released now. Yes maybe it's underdocumented, so any contributions here are welcome :) I am closing this by now. To cover the documentation, let's open a new issue to cover documentation.
Tests are not passing because of fetched aliases urls from webfinger module in event subscriber are localized, and comes with prefix. It's already reported and waiting for MR in https://www.drupal.org/project/webfinger/issues/3516129 ✨ Make endpoints unlocalized Active , as soon as this is merged tests will pass (at least in local it does). So waiting @swentel (and/or rtbc) to review it !
Adding tests and defining urls of endpoints with language not applicable option.
Need to say that I was wrong when I was stating :
... by default, the url prefix will add the langcode for every language...
By default, and is also recommended in language detect and select settings, that fallback language being set with empty prefix. This solves some things, but not totally, like when someone accesses the activity pub actor endpoint with language prefix, then all endpoints will use the language prefix. Also the fallback empty prefix is not forced, and if language fallback is changed must be set manually, so also could be harder to catch, so again better define url language as not applicable, as this MR does.
Yes, that's true, and it's really annoying how bots can bury a site. But there are some bots that can be "controllable". At least the nofollow is on of the rules that some search engine says that could be used to control spider bots... Anyway, maybe it will be better to allow to append custom attributes to each link of the pager, and let implementer to add whatever he wants?
Hi orkut,
did you saw that there's a 2.x version of the module with 10 compatibility? I'd be happy to see if it is working for you. I 'll try to check it when I end with the major effort by now; the move from mapbox gl to maplibre gl (
https://www.drupal.org/project/maplibre_gl →
) ... BTW I saw your site https://geoperformans.com , so good! for any kind of collaboration just contact me :)
Hi, sorry to necrobumping, if you think so please, omit this comment. I recently found exactly the same issue using a php in a debian with default configuration as it comes from apt repository. The way how is configured it using session.cookie_samesite = "Strict" made me waste a lot of time doing tracing here and there until I found that the cookie was stripped... So now I see, it's obvious(and I was suspecting it), and is something to be aware when using third parties auths, but I just confirmed what's said in this post.
So at least a note about it in Readme.md could help others with the same error, as the path from the error "Login failed. Invalid OAuth2 state" to the misconfigured php may be a long trace.
Adding patch for composer purpose
After testing, it just works.
True, I removed all composer requirements as only info.yml ones are needed in this case. thank you
It was completely unusable, I'll check it out next time... so sorry all to release this non-functional tag. Anyway, now I checked it and released a new one with functional code and some nest fixes: https://www.drupal.org/project/address_js_geocoder/releases/2.0.0-alpha6 →
Wow completely missed that... sorry. You are absolutely true. With this release:
https://www.drupal.org/project/address_js_geocoder/releases/2.0.0-alpha6 →
(which includes this big commit: https://git.drupalcode.org/project/address_js_geocoder/-/commit/e5b95cfe... I have refactored things a little.
So: no more jquery.once and the formatter uses the formatter plugin from geocode like this https://git.drupalcode.org/project/geocoder/-/blob/8.x-4.x/src/Plugin/Ge... to follow the recommendations of https://geocoder-php.org/docs/#formatters
I hope it will help you, if not I'll check your patch.
I couldn't test it by now, until next week I cannot check it out, but I could merge the MR if you can tell me please if geocoding is working as it should without any map in form , also if there's any error or message in browser console when trying to geocode any address.
I think that it must not depend on geofield_map module because geocoding must work without it, but maybe it tries to refresh something there...
Just merged (noisy commit for what it is...) into 2.0.x
Thank's for replying @akoepke, I am just writing again to let you know that I have created a minimal module to get this feature, as you said with a new plugin (also packing a block to inform the user of the rate limiting), it's in :
https://www.drupal.org/project/paywall_rate_limit/ →
I also created a new module to implement a paywall plugin depending on the subscription of a given simplenews , in:
https://www.drupal.org/project/paywall_simplenews_subscription →
Your module helps a lot ! thank you!
Subscribing! bump it pls
I requested to merge part of the proposal in dfp project.
However, reading the notes in https://klaro.org/blog/klaro-and-the-new-google-requirements-for-cmps-tcf- it seems that implementing google consent to satisfy ad personalization purposes makes no sense if what is wanted is to implement adsense and admanager as this will never happen for what could be read in https://klaro.org/blog/klaro-and-the-new-google-requirements-for-cmps-tcf- ...
Anyway, that work is there if sometime in the future google is forced to change the way is trying to comply with gprd within their ads service...
!27 MR was using bad branch dest...
!28 is the good one , with these changes, minor preprocess needs to be done to make it work with klaro. something like:
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_js_head_top(&$variables)
{
/** @var \Drupal\klaro\Utility\KlaroHelper $helper */
$helper = \Drupal::service('klaro.helper');
$service = $helper->matchKlaroApp($variables["google_tag_services_url"]);
if ($service) {
$variables['gads_dataset'] = [
'type' => 'text/javascript',
'name' => 'dfp_admanager',
'src' => $variables["google_tag_services_url"],
];
}
}
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_short_tag(&$variables)
{
/** @var \Drupal\klaro\Utility\KlaroHelper $helper */
$helper = \Drupal::service('klaro.helper');
$service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
if ($service) {
$variables['image_attributes'] = $helper->rewriteAttributes($variables['image_attributes'], $service->id());
}
}
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_tag(&$variables)
{
_dfp_klaro_preprocess_dfp($variables);
}
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_js_head_bottom(&$variables)
{
_dfp_klaro_preprocess_dfp($variables);
}
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_slot_definition_js(&$variables)
{
_dfp_klaro_preprocess_dfp($variables);
}
/**
* Adds the klaro attributes to each script preprocessed by dfp.
*/
function _dfp_klaro_preprocess_dfp(&$variables)
{
/** @var \Drupal\klaro\Utility\KlaroHelper $helper */
$helper = \Drupal::service('klaro.helper');
$service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
if ($service) {
$variables['script_attributes'] = $helper->rewriteAttributes($variables['script_attributes'], $service->id());
}
}
Thanks @szeidler, that's what I end up doing. But rather than editing the template directly, it's done in a way that if at some moment klaro is not used, the templates will work. I'll ping also dfp guys to check it out, maybe they could propose some other way...
Dfp adds the remote js script https://securepubads.g.doubleclick.net/tag/js/gpt.js using an inline script, but adding the klaro attributes to the inline script didn't help, so I need to add the klaro data attributes to this remote js
, so via preprocess, if we are using klaro to consent the service, a new variable 'gads_dataset' is added:/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_js_head_top(&$variables)
{
/** @var \Drupal\klaro\Utility\KlaroHelper $helper */
$helper = \Drupal::service('klaro.helper');
$service = $helper->matchKlaroApp($variables["google_tag_services_url"]);
if ($service) {
$variables['gads_dataset'] = [
'type' => 'text/javascript',
'name' => 'dfp_admanager',
'src' => $variables["google_tag_services_url"],
];
}
}
These new variable will be used in current theme template dfp-js-head-top.html.twig, it's done in a way that if at some moment klaro is not used the templates will work too:
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
// Add a place to store the slot name variable.
googletag.slots = googletag.slots || {};
(function() {
var useSSL = 'https:' == document.location.protocol;
var src = (useSSL ? 'https:' : 'http:') +
'//{{ google_tag_services_url }}';
{% if async_rendering -%}
var gads = document.createElement('script');
gads.async = true;
{% if gads_dataset -%}
{% for property, value in gads_dataset -%}
{% if property != 'src' -%}
gads.dataset['{{ property }}'] = '{{ value }}';
{%- endif %}
{%- endfor %}
{%- endif %}
{% if gads_dataset['src'] -%}
gads.dataset.src = src;
{% else -%}
gads.src = src;
{%- endif %}
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
{% else -%}
document.write('<scr' + 'ipt
{% if gads_dataset -%}
{% for property, value in gads_dataset -%}
{% if property != 'src' -%}
data-{{ property }}="{{ value }}"
{%- endif %}
{%- endfor %}
{%- endif %}
{% if gads_dataset['src'] -%}
data-src="' + src + '"
{% else -%}
src="' + src + '"
{%- endif %}
></scr' + 'ipt>');
{%- endif %}
})();
</script>
The short tag template is also controlled by klaro, this time the image attribute is defined with class Attribute, this way we could use the klaro helper to rewrite the attributes. The rewrite is done, like the previous template, if klaro dfp service is enabled.
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_short_tag(&$variables)
{
/** @var \Drupal\klaro\Utility\KlaroHelper $helper */
$helper = \Drupal::service('klaro.helper');
$variables['image_attributes'] = new Attribute(array(
'src' => $variables['url_ad'],
));
$service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
if ($service) {
$variables['image_attributes'] = $helper->rewriteAttributes($variables['image_attributes'], $service->id());
}
}
So the dfp-short-tag.html.twig in current theme is like:
<a href="{{ url_jump }}">
<img {{ image_attributes }}>
</a>
Then I create a common function to be used in dfp_js_head_bottom, and dfp_slot_definition_js
and dfp_tag preprocess functions. Used to rewrite the script attributes to comply with klaro requirements if service is enabled.
/**
* Adds the klaro attributes to each script preprocessed by dfp.
*/
function _dfp_klaro_preprocess_dfp(&$variables)
{
/** @var \Drupal\klaro\Utility\KlaroHelper $helper */
$helper = \Drupal::service('klaro.helper');
$variables['script_attributes'] = new Attribute(array(
'type' => 'application/javascript',
));
$service = $helper->matchKlaroApp(TagInterface::GOOGLE_TAG_SERVICES_URL);
if ($service) {
$variables['script_attributes'] = $helper->rewriteAttributes($variables['script_attributes'], $service->id());
}
}
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_js_head_bottom(&$variables)
{
_dfp_klaro_preprocess_dfp($variables);
}
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_slot_definition_js(&$variables)
{
_dfp_klaro_preprocess_dfp($variables);
}
/**
* Implements hook_preprocess_HOOK() for dfp templates.
*/
function dfp_klaro_preprocess_dfp_tag(&$variables)
{
_dfp_klaro_preprocess_dfp($variables);
// to be able to show box to allow show content
$variables['tag_attributes'] = new Attribute(
array(
'class' => ['dfp-tag-slot'],
)
);
}
So their template dfp-js-head-bottom.html.twig, dfp-slot-definition-js.html.twig will be a copy of the original but replacing the hardcoded script attributes with the twig script_attributes variable:
<script {{ script_attributes }}>
Note that the preprocess function dfp_klaro_preprocess_dfp_tag will also append the new class dfp-tag-slot to each dfp tag, this way we could add this class in classes with additional wrapper field in klaro service settings, so then a box to let user load the content will be there. The template dfp-tag.html.twig is like this:
<div id="{{ tag.placeholderId }}" {{ tag_attributes }}>
{% if tag.isSlugHidden == false and tag.slug %}
<div>
{{ tag.slug }}
</div>
{% endif %}
<script {{ script_attributes }}>
{% if tag.isAsyncMode %}
googletag.cmd.push(function() {
{% endif %}
googletag.display('{{ tag.placeholderId }}');
{% if tag.isAsyncMode %}
});
{% endif %}
</script>
</div>
Finally the config of the klaro service is like this:
status: true
dependencies: { }
id: dfp_admanager
label: 'Google Ads'
description: 'Integrates DFP Google Publisher Tags onto the site'
default: false
purposes:
- advertising
cookies: { }
required: false
opt_out: false
only_once: false
info_url: 'https://admanager.google.com/home/'
privacy_policy_url: 'https://policies.google.com/privacy'
javascripts:
- 'https://securepubads.g.doubleclick.net/tag/js/gpt.js'
- 'https://pubads.g.doubleclick.net/gampad'
- securepubads.g.doubleclick.net/tag/js/gpt.js
callback_code: "window.dataLayer = window.dataLayer || [];\r\nfunction dfp_gtag() {\r\n dataLayer.push(arguments);\r\n}\r\nif (consent){\r\n\r\n // we grant ad storage and personalization\r\n dfp_gtag('consent', 'update', {\r\n 'ad_storage': 'granted',\r\n 'ad_user_data': 'granted',\r\n 'ad_personalization': 'granted'\r\n })\r\n} else {\r\n // we decline ad storage and personalization\r\n dfp_gtag('consent', 'update', {\r\n 'ad_storage': 'denied',\r\n 'ad_user_data': 'denied',\r\n 'ad_personalization': 'denied'\r\n })\r\n}"
wrapper_identifier:
- dfp-tag-slot
attachments: { }
weight: -5
Note that the callback code will be:
window.dataLayer = window.dataLayer || [];
function dfp_gtag() {
dataLayer.push(arguments);
}
if (consent){
// we grant ad storage and personalization
dfp_gtag('consent', 'update', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted'
})
} else {
// we decline ad storage and personalization
dfp_gtag('consent', 'update', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied'
})
}
So it will implement consent mode V2 changes as told in https://klaro.org/docs/tutorials/google_tag_manager (The dfp_gtag is used because gtag function is not defined yet, because the script is executed before the gtag.js in google_tag module.@mlcn big thanks !
Also updated the library to 4.32.2
Created a new branch and a patch with the changes to try to support the current D11. Knocking to request a review please!
aleix → created an issue.
Great @bkenro ! Your feedback/contributions are welcome.
I am sorry but I couldn't reproduce despite I installed everything from your repo from the scratch, I have set the php environment again with php8.3.
What I see was that the load of the filepicker inside the modal was triggering:
Allowed memory size of 134217728 bytes exhausted (tried to allocate 134217736 bytes) in drupal-project/vendor/mck89/peast/lib/Peast/Syntax/Utils.php on line 37
And the filepicker was not appearing (I am using firefox, maybe in chromium i could see your modal error). The error was the same if setting the entity browser to be standalone form .
I have not inspected too deeply but I suppose that it's because i was using js aggregation or the load of nc filepicker libraries together with xdebug , a low memory_limit and 30 seconds of execution limit for php.
Anyway disabling xdebug make it work...
Maybe you have xdebug enabled? or low php memory_limit ?
I try to inspect a little more if this js load could be reduced, or try to load differently the vue filepicker (async???) to prevent this wait and allow the use of xdebug but by now disabling xdebug just to allow the load (after first load it may be enabled again) it's the way to make it work (if you face with the same xdebug issue) .
I try to reproduce, but no way... The key error in:
TypeError: key(): Argument #1 ($array) must be of type array, null given in key() (line 424 of /var/www/demo/web/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php).
refers to entitybrowser, could you paste the entitybrowser config from single export in config > development and also the entity form view of the article content ?
(also the answers to the questions in previous comment could help)
...
Let's see if we can solve this.
Great! let's see, It happens before loading the node form or after submitting the node form?
As I said, filling the media via media form, without using entity browser is not implemented (it must be at some moment).
Hi @bkenro . Let's see if you did the required setup. Did you picked the remote share with the filepicker in widget field? Or just filled the field url with the remote url? If thats the case i am sorry but just using the url without using the picker will not populate the metadata, (but it may be implemented at some point)
To confirm and be more specific, i need more information to reproduce. Could you send the configuration of the next cloud media image? the ymls of the media, the yml of the view modes and form modes, the yml of the field storage and formatter... If not a screen capture video may help.
Fixed not enforcing field storage config on this module.
It's fixed in last dev with the refactoring of manager in commit https://git.drupalcode.org/project/licenses_vocabulary/-/commit/dbb5c90e...
Added a checkbox to let user choose if defaults needs to be imported in config form, i hope it suits your needs too.
Done! let's see other ones, ty!
Sounds good, let's do it, I'll take a look asap. I'll try to merge every one of your proposals in next days.
Finally 11 version there ! will tag as beta
Great! Thank you ankitv18. I will release it as soon as ci tests that are running now pass.
aleix → created an issue. See original summary → .