I also need something like this. The methods and hooks should all support an $options parameter.
hook_facebook_pixel_event_data_alter(array &$data, $event) could be changed to
hook_facebook_pixel_event_data_alter(array &$data, $event, &$options = [])
Then the js would change from
fbq("track", event['event'], JSON.parse(event['data'])); to
fbq("track", event['event'], JSON.parse(event['data']), JSON.parse(event['options']))
also
public function addEvent($event, $data = '', $start_session = FALSE) to
public function addEvent($event, $data = [], $options = [], $start_session = FALSE)
In the meantime, I'm overriding the controller with my own that adds it to the user data. But altering the data could be useful to other modules.
Or possibly a config setting that includes external_id in the user data, or maybe even a token field in case you wanted you use something other than the numeric drupal user id.
MR13 is ready for review. This should work with any route that has an entity in the route params.
It checks for node first, then uses the first entity found in the route params.
This eliminates the need to hardcode fallback entity types in the evaluate code.
MR13 gets this working for taxonomy_term entities.
MR12 changes the UI to use a separate autocomplete field for each vocabulary, instead of a single autocomplete for all vocabularies.
Yea, those CI checks were left of from me debugging the test. I have removed them and applied your other suggestions.
Should be good now. Thanks!
Resolved merge conflicts and added a new kernel test CropImageStyleFlushTest
Well, in my case its not really a matter of security. The variations are published and if a user has the direct link they can access it, and if someone just guesses the id and finds it, thats fine. I just don't want to advertise that they are there unless a site admin gives them the direct link.
I think in the meantime I can just add the select box and alter it to a 'value' element in my form alter.
But this did feel like a bug, because the product display shows the specified variation's price and attributes when viewing with ?v=123 (even though there is no select element to directly choose it), but a different variation than what is displayed is added to the cart when they submit the form.
Applied The code review suggestions and rebased, to help move this issue along.
Everything is passing. There is one warning for an unrelated issue.
MR52 gets everything to pass. all checks are green.
Rebased the MR and updated the readme as requested by @istryker
@jatin812 loadByProperties isn't going to correctly load a config entity like that. your original approach using the role id was correct.
Ive made a few adjustments, tests are passing. Sorry for all the noise in the logs.
I think this is working well now and ready for review.
Attached is a screenshot showing the field that it adds to the group type config form.
This allows an admin to set the default membership type used for new memberships of a group type.
I have also added a few unit tests in GroupTypeManagerTest for getting and setting default memberships, as well as a new kernel tests file GroupMembershipTypeConfigTest.
Im pretty new to writing tests, I think they are correct, but could definitely use another set of eyes on them. They are all passing.
Thanks!
I just realized the actual feed looks correct. This is just in the views UI preview so I suppose this is fine.
For anyone that is trying to get html emails to work. you can override the text format setting in hook_mail_alter() by setting
$message['params']['text_format'] = 'your_filter_name';
But is seems like the select box should actually do the opposite: limit the filters to ones that DON'T escape html. (or just not limit them at all)
Yes, the MR is ready for review. It solves the original issue, and allows default permissions (for roles other than administrator) to be unelectable by site admins. It also includes my attempt at a test, which passes.
I will open new issues for the other points raised here. Thanks
apparently I had inadvertently updated geolocation to 4.0 reverting to the 3.x version got everything working again.
The output format is empty, even though there are #options in the element.
see screenshot
@joelpittet Yes it is something I am looking for as well. Happy to help test whatever you come up with.
@amitaibu - I agree.
Its rare, if ever, that I give group admins the full admin role with every single permission. Instead I typically have been creating a "manager" role that has some elevated permissions, but not all of them. Having a setting to auto assign group owners to a selected role, would be helpful.
Should the "administrator" role still get all permissions and the permissions be disabled. (like the admin role in core) Or should we leave it up to site admins which permissions to assign to the og administrator role?
I tested MR 44.
adding the filter works, in preview mode, but when I attempt to save the view I get the following error
The website encountered an unexpected error. Try again later.
InvalidArgumentException: The configuration property display.default.display_options.filters.roles_target_id_1.value.node-group-moderator doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 95 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters.roles_target_id_1.value.node-group-moderator', 'node-group-moderator') (Line: 258)
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters.roles_target_id_1.value', Array) (Line: 258)
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters.roles_target_id_1', Array) (Line: 258)
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters', Array) (Line: 258)
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options', Array) (Line: 258)
Drupal\Core\Config\StorableConfigBase->castValue('display.default', Array) (Line: 258)
Drupal\Core\Config\StorableConfigBase->castValue('display', Array) (Line: 258)
Drupal\Core\Config\StorableConfigBase->castValue(NULL, Array) (Line: 211)
Drupal\Core\Config\Config->save() (Line: 278)
Drupal\Core\Config\Entity\ConfigEntityStorage->doSave('group_moderators', Object) (Line: 486)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 257)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 617)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 1007)
Drupal\views_ui\ViewUI->save() (Line: 358)
Drupal\views_ui\ViewEditForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('view_edit_form', Array, Object) (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'edit', Array) (Line: 220)
Drupal\views_ui\Controller\ViewsUIController->edit(Object, 'block_1')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Just created a new release 1.0.1 with Drupal 11 support. Thanks
I actually went in a different direction and am not using this module. So I will be unable to work on this.
MR173 addresses the 2nd part of the IS. It adds the 'avatar' to the $context array allowing you to alter it like this.
function MYMODULE_tagify_autocomplete_match_alter(?string &$label, ?string &$info_label, array &$context): void {
// if avatar is empty use our own default
if (empty($context['avatar'])) {
$context['avatar'] = $my_default_image_url;
}
// Change avatar of users with a custom role.
if ($context['entity']->hasRole('CUSTOM_ROLE')) {
$context['avatar'] = $my_custom_image_url;
}
}
I will hold off on the first part until I hear from the maintainer if they think moving the user avatar settings to the main config form is a good idea. I think we should move both image_field and image_style to the global config so it does not need to be set per field. On any given site the user entity only really ever has one field and size needed for avatars.
And here is the patch to help test it with composer
I've created MR10 as an attempt to improve the regex for common cases with text editors.
Moderators may inadvertently add or regular spaces, or the URL may be wrapped inside a <div>.
These are situations I frequently encounter with moderators who are not familiar with HTML and often complain, "My links don't embed." In 99% of cases, the issue is that the HTML is slightly malformed, and they don’t know what to check or how to fix it.
These changes are in the latest releases
@idebr Thanks for the review!
We still need the TempStore for now, although it’s doing much less than it used to. I did try to remove it, but if I remember correctly, the issue was related to how the form is submitted in the controller. Some of the required data just wasn’t available at that point. I think it mainly had to do with identifying where replies belonged when multiple forms were present on the page. It’s been a while since I looked at that part, so I’ll need to step through it again to confirm.
The JS commands for items 2 and 3 are no problem.
This approach is working, but I think a cleaner long-term solution would be to create a dedicated FieldFormatter specifically for AJAX forms. That would give us more control over the structure and eliminate the need for complex alters and passing field settings around. I started going down that path but wasn’t sure if it was too big a departure from the original implementation. However, if we’re moving to a new branch where breaking changes are acceptable, I think that’s the way to go.
Tried testing the MR. it applied, but I was unable to get it to work.
The images appear to upload in dropzone. but when I click the submit button I get an error message "At least one valid file should be uploaded."
and in the js console i have
VM11500 drupal.js:64 Uncaught TypeError: Cannot read properties of undefined (reading 'element')
at VM11522 dropzonejs_eb_widget.common.js:15:39
at Array.forEach (<anonymous>)
at Object.attach (VM11522 dropzonejs_eb_widget.common.js:14:60)
at VM11500 drupal.js:166:24
at Array.forEach (<anonymous>)
at Drupal.attachBehaviors (VM11500 drupal.js:162:34)
at HTMLDivElement.<anonymous> (VM11520 ajax.js:1404:18)
at ce.each (VM11495 jquery.min.js:2:3129)
at ce.fn.init.each (VM11495 jquery.min.js:2:1594)
at Drupal.AjaxCommands.insert (VM11520 ajax.js:1396:19)
Both the EB Media Dropzone widget, and the EB Media Dropzone widget with edit widet.
The patch intended for 10.5 in #47 applies but did not work for me. Does someone have one?
I got this error
ajax.js?v=10.5.4:1143 An error occurred during the execution of the Ajax response: CKEditorError: Cannot convert undefined or null to object
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-Cannot convert undefined or null to object
This is working as expected in my initial testing, I will continue to test it out with other providers. But this is now inline with what the core Media module is doing with the oEmbed field formatter.
And here is a static patch to test with composer.
I've only tested this minimally but it appears to be working well for me. Thanks!
I think this is pretty good now, Ive tested several different api reports methods and it seems to be retrieving the data correctly.
The latest code is in MR18.
This should now:
- Support all the reporting methods the api provides.
- Work if the params are cameCase or snake_case.
- Provides an option for forcing a cache refresh.
- Cleans up coding standards
- Better error handling when fetching data fails.
Here is a patch to use with composer if anyone want to test it out.
I made another improvement.
The static array key map that @mugesh.s added was good, but didn't cover all potential parameters. Instead of maintaining a static list, I added a method convertParamKeysToSnakeCase() that will replace all the first level keys in $params[0] with snake_case versions.
Ive added a few things to MR18
1. Supporting additional report request types
- RunPivotReportRequest();
- RunRealtimeReportRequest();
- BatchRunReportsRequest();
- BatchRunPivotReportsRequest();
- RunReportRequest();
2. Allow forcing a cache refresh for the api call.
you would call it like this in your module.
$service = GoogleAnalyticsReportsApiFeed::service();
$feed = $service->runReport($params, ['_refresh' => TRUE]);
GoogleAnalyticsReportsApiFeed::service()->runPivotReport($params); is not working.
I think we need to do something like this
switch ($func) {
case 'runPivotReport':
$params[0] = new RunPivotReportRequest($converted);
break;
default:
$params[0] = new RunReportRequest($converted);
}
It appears there is a setting for this in the dev version.
Created a MR of the 2 line patch in #10 to help move this along.
4 years later the patch still applies and works. +1
patch here works 📌 Support styling Hosted Fields RTBC
It looks like this module implements its own CSRF token logic. What was the rationale for not using Drupal’s built-in _csrf_token: TRUE in the router? From my understanding, defining this in the route (similar to the Flag module) could eliminate much of the custom token-checking logic and simplify the code significantly.
Would love to get tome input from the maintainers.
This MR does 2 few things.
1. It passes the parent entity to the oembed_lazyload_placeholder theme function.
2. Adds an option in the display formatter to choose the image field (if any others exist on the bundle) to use in the placeholder.
Should we also clear any configured default membership type for this group bundle to keep programmatic removal consistent with the UI flow?
Yes, I think you are right.
This is a super old issue, but I am looking to do the same and didnt see a way to do it.
The field settings should allow you to specify a directpry and support tokens like an image field does.
I can work on this if the maintainers think this is something that will be added.
Added a small fix for an undefined variable error that was showing in the logs on a last page of comments.
heres a new patch for composer.
And here's a patch you can use with composer.
I've updated the IS and made a few final updates to MR !13. All tests are passing.
Since this fundamentally changes how the module works (single comment insertion instead of full rebuilds), I suggest creating a new 2.x-dev or alpha branch. This way current users can stay on the stable 1.x branch while others can test the new approach.
I've been using this in production on several sites for a while now - it's been solid across different scenarios including sites with hundreds of comments, multiple comment fields, views, etc.
This issue has been open since 2020 and I've put a lot of work into making this a comprehensive solution. It fixes the original problems, resolves several related issues, and brings the module in line with how the D7 version and modern commenting systems work.
Would the maintainers be open to creating a 2.x branch for this?
Happy to help with any follow-up work needed.
Thanks!