Craft CMS

How to fetch all assets that are in use, via a specific field

We have a channel of entries which all include the same asset field. We are trying to fetch all assets that are actively in use, ergo the assets which have been linked to any of the entries in the channel via the specified asset field. If possible we would also ....

Lucy Lucy: 1 hour ago


Get first URL from custom field, download and set as featured image on post publish

I have a plugin that is adding text and a URL to a custom field when the post is published (not saved as draft). I want to get/make a function or plugin to search within the custom field and sideload the image from a URL, then add that image as ....

Nova Nova: 1 hour ago


Access Denied Error when calling REST Call for specific user

I have created a script to fetch data from the list in SharePoint Online. To do so, there has been given a REST call to the list to fetch data. There is one user who is facing the issue that is shown in the screenshot. https://<<siteCollection>>/_api/web/lists/getbytitle('FAQ')/items?$select=*,Function/Title,Region/Title&$expand=Function,Region The issue comes for ....

Logan Logan: 1 hour ago


can't change the value of ONE button (search page SEARCH button)

I have succesfully changed the search button text of the block but can't seem to get to do this on the search page on the following form_alter both forms enter it and are set but only search_block_form gets affected function MODULE_NAME_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { if(in_array($form_id,)) { $form = "Custom ....

Silas Silas: 1 hour ago


Pages other than Home page not displayed even when URL is good

I installed WordPress on a dedicated server running Debian and each time a create a new page ( I can't access it, and when I try I get the error: Not Found The requested URL /mynewpage was not found on this server. Even when I modify it in the WP ....

Nora Nora: 1 hour ago


SharePoint App "SPAppWebUrl" query string is missing after using "SharePointContextProvider.CheckRedirectionStatus"

When using a direct link(bookmark) to a page in my provided app the "SPAppWebUrl" query string is missing and the SPContext.CreateAppOnlyClientContextForSPAppWeb() is null. This happens after the current user has been authenticated in the "SharePointContextProvider.CheckRedirectionStatus" method: protected void Page_PreInit(object sender, EventArgs e) { switch (SharePointContextProvider.CheckRedirectionStatus(Context, out redirectUrl)) { case RedirectionStatus.Ok: ....

Aiden Aiden: 1 hour ago


Is there any way to import bunch of new products using OData API in Sitecore Commerce 9?

I found that there are no OData API methods for importing new products into the catalog of Sitecore Commerce 9. The only thing you can do is to use /api/DoUxAction() to add new sellable item and then associate this sellable item with inventory. But the JSON object being sent is ....

Isaac Isaac: 1 hour ago


Javascript running twice when not logged in

I have this issue that any custom js (added into file) script file is runned twice. However, I noticed that it will be runned only once if I am logged in. This happens in Drupal 7. What is the cause? The js script is a clear only having alert("Entered ....

Emilia Emilia: 1 hour ago


I can't backup my website on a shared server because memory runs out. What can I do?

I have a large Drupal7 website on a shared Hostgator server, and I cannot do automated backups because I always run out of resources. I've tried 2 methods: 1) I first built my own CLI bash file and I set up a cron job to execute it every night. The ....

Chloe Chloe: 1 hour ago


How to create object by it's name?

I'm writing a REST service which calls external service. I want to write a test for my service. I came up with no possibility to mock this call as it's in managed package. I want to wrap this call with Test.isRunninTest() method. And here is the problem - I can't ....

Nova Nova: 1 hour ago