This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Download file from authenticated file URL

Thanks in Advance!!
 

In my site, Some media's assets are stored in private folder. I have a custom form where i am using these media assets. When user load the page they are granted the access to use those medias by "private file download access" module. My question is when user submit the form. These media should be also save in public folder. I am doing this by file_get_contents() function (download file from url). See the below code:

Filter table by ajax submitting not refresh pagination.

Dear Drupal community,

Need help, pagination not reset after filtering table via ajax submitting. Guide me what I am doing wrong.

Trusted Host Settings

I followed the link to https://www.drupal.org/docs/installing-drupal/trusted-host-settings followed the instructions. They echo my video tutorial instruction.

I edited sites>default>setting.php

$settings['trusted_host_patterns'] = [
  '^www\.ukspeaking\.com$',
 ];

it returns this message on my site:-

'The provided host name is not valid for this server.'

How to set File from temporary://file.jpg

I thought I could figure this out, reading the Entity\File.php class governing this entity.

Through a theme, I've uploaded an image in its logo upload form in its settings. I see the file in managed_file with a URI of 'temporary://mylogo.jpg'and a status of 0 which indicates to me that it's in a temporary state that will be destroyed during the next cron run. 

In drush php,

Drupal Gap

How can I get more information on DrupalGap? Would using it be recommended? The community seems very small and not very active right now.

Ordering in mysql query giving syntax error

Hi,

I am trying to order my query like so:

$query = db_query("SELECT * FROM `heritage_source_info`WHERE text_id = :textid AND format = :format ORDER BY type ASC", [':textid' => $textid, ':format' => 'text'])->orderBy('FIELD(type,moolam,translation,commentary)');

$available_sources_text = $query->fetchAll();

But it says call to an undefined function orderBy(). Could you help me with the correct syntax?

Thanks

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions