texts: How do you add a PDF attachment to an email?

texts:
Goal: I need to send an email with a pdf attachment in Drupal 8.

Progress

I am able to send an email with subject and message but have never been able to get the attachment. When I turn on the logic to attach the file to the email, the email never gets sent but the mail service returns True as if the email was sent anyway. There are no errors and the logs say nothing.

I have the following modules installed:

SMTP
MailSystem
MimeMail

What I've tried

Tried using $message['params']['files'][] = $params['attachments'] instead of $message['params']['attachments'][] = $params['attachments'] like some examples have recommended
Tried changing $file->uri to $file->filepath
Tried attaching the file like so:

$params['attachments']['filecontent'] = $this->generatePDF($foa_list);
$params['attachments']['filename'] = 'MyFormsOfAssistance.pdf';
$params['attachments']['filemime'] = 'application/pdf';

Tried attaching the file by path alone with an array:

$attachment = array(
    'filepath'=>'sites/default/files/MyFormsOfAssistance.pdf',
);

$params['attachments'] = $attachment;

Tried attaching the file a different way:

$attachment = array(
    'filepath' => 'sites/default/files/MyFormsOfAssistance.pdf',
    'filename' => 'MyFormsOfAssistance.pdf',
    'filemime' => 'application/pdf'
);

$params['attachments'][] = $attachment;

Setup

There is email landing page in which a user enters the recipient's email address, subject for the email, and message for the email.
When user clicks Send button, that data is routed to my Email Controller
Email controller creates the pdf file, attempts to attach the pdf to the email, and then sends the email.
I have the hook_mail() function defined in my module file.

Here is the code for my Email Controller:

public function submit_email($foa_list = null) {
    $lang = "en";
    $email_to = "blah@blah.com";
    $params['subject'] = "Test subject";
    $params['body'] = "Test body";

    // -------------------- Attachment Logic -----------------------
    // Create pdf file and store file
    file_put_contents('sites/default/files/MyFormsOfAssistance.pdf', $this->generatePDF($foa_list));

    // Attach pdf file to email params
    $file = new \stdClass();
    $file->uri = 'sites/default/files/MyFormsOfAssistance.pdf';
    $file->filename = 'MyFormsOfAssistance.pdf';
    $file->filemime = 'application/pdf';
    $params['attachments'][] = $file;

    // Send email
    \Drupal::service('plugin.manager.mail')->mail('email', 'email', $email_to, $lang, $params);

    $response = new Response();
    $response->setContent("true");

    return $response;
}

Here is the hook_mail() code in my Email module file:

// Note that print_and_email is what my module is called.
function print_and_email_mail($key, &$message, $params) {
    switch($key) {
        case 'email':
            $message['subject'] = $params['subject'];
            $message['body'][] = $params['body'];
            $message['headers'] = [
              'MIME-Version' => '1.0',
              'Content-Type' => 'text/html; charset=UTF-8; format=flowed; delsp=yes',
              'Content-Transfer-Encoding' => '8Bit',
              'X-Mailer' => 'Drupal',
            ];
            // $message['params']['files'][] = $params['attachments']; // Note: I have seen other examples implement attachments this way
            $message['params']['attachments'][] = $params['attachments'];
            break;
    }
}

The Drupal 8 documentation isn't really helpful and I would like to be able to figure this out without installing SwiftMailer, like some sources have recommended. Really not sure why this isn't working as it has worked for others. What am I missing?


texts:
I have created 2 different groups and updated content(basic pages & article) using group module in my drupal 8 project.

Currently it is listed in nodes tab of group.

I have used an view module to group based on the content type. But i couldn't make it.

Can anyone help me out?


texts: How to remove the ADD USER in the “admin users area” in Drupal 7

texts:
I already did the admin only register but I would like to remove this tab if anyone can help me

Thanks


texts:
Is there is any modle avaibale for mini player like

http://pupunzi.open-lab.com/mb-jquery-components/jquery-mb-miniaudioplayer/

I want to implement same player on my website


texts:
I have defined a new content type, statetype and a CCK field, state.
I need to use the CCK field as primary key in this table because I have another table and I need use that field as foreign key. (This code and table is not Drupal and i wrote it myself, but it uses a Drupal table.) I should change state field to primary key in the "statetype" table but Drupal already defines vid as primary key. Is there any problem if I define multiple primary keys (vid, state) or if I remove vid as primary key?


texts:
Is it possible to use a wysiwyg editor like TinyMCE for editing content in panels.  I want to be able to use TinyMCE for editing 'custom content'.

Another note: is it better to create nodes and just add them to the panel or to use the 'custom content' feature?  Thanks!


texts: Composer shows "nothing to update" but there is a new version of the module

texts:
I am managing a Drupal 8 site in Composer.  Commerce 2.0 was just released; I currently have 2.0-rc2 installed on my site.
This is my composer.json
"drupal/commerce": "^2.0@RC",

"minimum-stability": "dev",
"prefer-stable": true,

To update, I ran composer update drupal/commerce --with-dependencies, which gave me this result:
Gathering patches for root package.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "drupal/core" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
Warning: Ambiguous class resolution, "Drupal\Component\Utility\Random" was found in both "$baseDir . '/web/core/lib/Drupal/Component/Utility/Random.php" and "/mnt/c/Users/x/d/mysite/vendor/drupal/drupal-driver/src/Drupal/Component/Utility/Random.php", the first will be used.
Removing packages services cache file:
/mnt/c/Users/x/d/mysite/vendor/drupal/console/extend.console.uninstall.services.yml
Creating packages services cache file:
/mnt/c/Users/x/d/mysite/vendor/drupal/console/extend.console.uninstall.services.yml
> DrupalProject\composer\ScriptHandler::createRequiredFiles

So Commerce does not get updated to 2.0 (I already updated all the dependencies to their latest versions.)
I thought it might be a caching issue so I ran composer clearcache and then attempted to update commerce again, but I got the same result (nothing to update).
I thought it might be an issue with the composer module list being out of date, but Commerce 2.0 was released more than 48 hours ago.  So what can I do to get composer working in this case?
EDIT
My repo is based on the Drops 8 Composer repo from Pantheon, which is in turn based on drupal-composer/drupal-project.
Deleting the /vendor directory and running composer update gives me this error:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Changing composer.json to "drupal/core": "^8.4@RC" "symfony/css-selector": "~3.2" also results in the same error.
But, running composer install or running composer update drupal/modulename allows me to install the site and update individual modules (except Commerce) without any problem.


texts: Add help text to checkbox options on node form

texts:
How can I add help text to each option on checkbox option on drupal node form. I do not want to add this from UI while adding values for the field. Using hook_form_alter I do not believe we have option to add description to options of a checkbox field.

Example: "which game you want to play" is the checkbox field.

which game you want to play?

[] cricket

-- cricket is awesome.

[] football

-- football is more than awesome.


texts: Is there a way to manage a vocabulary with drag&drop when there are more than 100 terms?

texts:
In Drupal 7, out of the box, it looks like the manage vocabulary page at  /admin/structure/taxonomy/myvocabulary handles 100 terms.  My vocabulary has about 500 terms, and I'd like to rearrange it into a parent and child structure.  Ideally, I'd like to get it all on one page to manage; is there a way to do this?

Otherwise, how am I supposed to reorganise a vocabulary spread out over 4-5 admin screens?


texts: How to add block to a single page that is not included in the allowed content type list?

texts:
We have a block (block_description) that is some text that we want to be displayed on all the content type except the article content type. However, there is a requirement now to display the block on just one of the article content types.

How can this be done with the following settings below on the block?

Current settings (e.g. admin/structure/block/manage/block_description):

Content type: Basic Page (allowed)
Other facet: default values
Content Types: Not restricted
Pages: No restrictions
Roles: no restrictions

Goal:

Add block_description to just article-1 (a single Article content type page)


texts: How to Uninstall/Reinstall a custom module whithout losing the content?

texts:
As we know : it's impossible to unsintall a module whithout being forced to remove all the data that's belongs to it.
The problem is, if we want to update a module we are obliged to uninstall it and then reinstall to get the changes work.

At developpement phase, it's ok , but what about being in a production site and having a big amount of data we don't want to loose, by just adding a field , or changing a type ....

Is there any best practises? Is there a process that could be advised? Is there any feedbacks of your own experience?

For example, I would guess : export data and then import data after the reinstall?

Thank you so much!


texts: How to make owl-carousel fade effect to work with multiple images not for a single one(as said in documentation)

texts:
I have an Owl Carousel view, and I need to load 5 items per slide, but I want to use fade effect instead of slide. Fade effect is said to work only for single item per page slideshow.

Is it possible to make the fade effect work for multiple images in a row?


texts:
Trying to get a button working in content item but ckeditor won't let me.

I tried pasting in source. But when toggling back and forth bewteen source and rich text editor the html changes.

Goes from:

<button>click</button>

To

click

I've tried:

<button>click</button>

Not working either.

This never happened before, a settings thing?


texts:
I'm trying to add a "add more" button on my webform. I tried "Webform Add More" module, but I need to add fields as user request instead of show and hide fields as user request another one. Is there any way to programmatically add fields to webform in a custom module?

I can't make a webform with the same field repeated 30 times if a user want to submit 30 different items.

I'm currently using Webform 3.18 and Drupal 7.38

Thanks for the help.


texts: Is there anything like attached data storage for a view?

texts:
I'm having hard time using Views with i18n Views. What gets me very irritated is that the translations of global fields (headers, footers, etc.) get lost whenever I make changes to that View. I would feel more comfortable if I could somehow permanently attach to a view some custom data, variables, i18n string arrays, and use them both in Views UI and tpl files.

I would imagine to declare a variable named %my_footer and provide its translations in a module. Then, in a footer I imagine being able to enter something like
This is %my_footer
 or call in a tpl file by saying something like ` and have it rendered in the current translation.

The only thing I would hate to compromise on (as instructed by many users here) is to use PHP code in Views UI text fields.

So, is my scenario possible? I just love to have a single data source...


texts: Two Login Forms for the Site in Drupal 7

texts:
I've a site setup in Drupal 7 where every user who is not authorized is shown a username/password page through Logintoboggan Module.

All went good, until a unique requirement came.

First Scenario:-

I need to have a universal login page which will only have a password field. So whenever a user comes to the site and is not logged in, he will be shown a page with only Password Entry, where he will enter a password and will enter the site. The role of this user would be Authenticated User.
(I guess this can be done if I hide the username field somehow and pass a hidden username field along with the form )

Second Scenario:-

Whenever user, who is not logged in, wants to log in as an admin, he/she will enter the URL as www.site.com/admin and should be shown normal authentication page, which will have username/password field. One can then, enter the credentials and enter the site as an admin (normally, as we are doing now with every page).

Hence, I need two login page forms; one would have only password field and other would have normal username/pwd fields at a specific URL.

I'd be very thankful if you can help me in any regard.

Thanks.


texts: How can I watch videos of the presentations from DrupalCon Sydney for free?

texts: I live too far away from Australia so I was unable to attend DrupalCon Sydney.  Is there any way to watch the videos online?  I tried looking on Blip.TV (where the videos for other DrupalCons are) but I couldn't find them.


texts: How to implement a Comment Reply Form through Views and using JS?

texts:
We have a comment body, using views, where we have the name, comment, picture, and date for each of the posted comments. At the end of all comments we have a comment body, where one can add a comment.

Now this works great for a linear comment system, but we want a threaded system in place. In views, I can add a reply comment link, but that takes me to a new page.

What I want is JavaScript based action, such that the comment form, goes below the reply link when reply button is clicked. Is this possible via views?

If not, what's my best option?

UPDATE

I enabled a module called ajax comments. This works great with default drupal comment system, but not so much with views. I added the required classes, and got the basic thing to work but the newly added comment doesn't appear until you refresh the page. Also the message (queued for moderation) comes at the bottom of the page.

If someone has set this module up successfully with views, please let me know.


texts:
Our customer wants to have this plugin within drupal: http://www.fyneworks.com/jquery/star-rating/#tab-Testing and I cannot get it to work.

The basic code works, I can create stars and have them display a stored value.
However, I want to use the callback functionality and this is not working, not even when I copy the test code from the site above to a blank page.

There are no stars (just radiobuttons), when I add star as a class I can see the stars again but then the callback will not work (as mentioned on several pages).

I figured it might have something to do with the version of jQuery so I installed the jQuery Multi module and the most recent jQuery (1.7.2) and enabled that for the star rating plugin, but this did not help. Any tips on how to proceed/debug?

I am no jQuery expert, I tried looking at the plugin code to see if something was missing, but could not understand it and nobody else complains about this not working (except if they did something wrong with the callback functionality).

edit:
I failed to mention that the entire page is constructed from php ignoring drupal things like blocks or nodes, this makes it hard to use the 5-star module. This was not my choice and a very bad way to use drupal, but that is what I have to work with, unfortunately.


texts: is it possible to set a twig in routing.yml?

texts:
I am working with Opigno, which may be helpful to know.

My end goal is to have my own twig file for the page that shows this information from the module.

Here's the routing.yml entry:

# Module result page.
opigno_module.module_result:
  path: 'module/{opigno_module}/result/{user_module_status}'
  defaults:
    _controller: '\Drupal\opigno_module\Controller\OpignoModuleController::userResult'
  requirements:
    _entity_access: 'user_module_status.view'
  options:
    parameters:
      opigno_module:
        type: entity:opigno_module
      user_module_status:
        type: entity:user_module_status

I was hoping that I could add a "_theme: 'somepath'" so that I can use my own twig file here. Unfortunately, the link on the D8 site has "TODO" next to _theme.


texts: Can a Webform display the last submitted version of instead of creating a new submission

texts: I have a web form that is embedded into a field on a content type and wondering if the form has been already submitted can you display the webform/manage/webform_name/submission/webforn_numer/edit form instead?


texts:
I'm building a custom theme for Drupal 7.xx, which is part of my internship.
I've been developing this theme for quite a while now, but I still consider myself an absolute beginner when it comes to theming for Drupal.

During the process, I've ran into quite a few problems which (luckily) I've been able to solve with the help of google (including Drupal Answers) so first of all thanks for that!

One of the problems I seem to be unable to solve, is that I cannot see the page content anywhere. So far I've added all content of the pages in blocks, which I've assigned to be rendered out by a region called 'cont_page_block', and which I have declared in my .info document.

To clarify: When I add a new page, I fill in the page title and body, but it doesn't appear on the page. Also, when I add a news article, I can see the teaser on my 'news summary' but when I try to click on it (which works though) it redirects me to a new page (URL states ?q=node/xx) which is, ofcourse, empty.

Here's the code I use in my page.tpl.php file to render the region:

   <div class="cont_page_block">    <?php print render($page['cont_page_block']); ?>
                                    <?php print render($content); ?>               </div>

And here's the declaration of my regions in my .info file:

regions[cont_page_block] = content-page-block
regions[content] = content

Am I missing a line of PHP code in my page.tpl.php file?
Any help would be greatly appreciated!


texts: How do I create a route that is specific for a subdomain?

texts:
I'm looking to create a "subdomain" path to my custom controller running on a Drupal 8 site, with routing and hopefully without the need for an additional module.

The idea is to for example have a route like account.example.com or dev.example.com point to a custom controller I've made in my module. Or a path like api.example.com for external REST queries.

All the documentation describe just the traditional example.com/path methods, and googling resulted to nothing, but the domain module, which seems excessive and maybe for a different purpose even.

What I wish to achieve is not a separate installation sharing the content, but just a path to my controller that is domain-specific, like the i18n module is able to provide the language parameter as subdomain or path prefix.


texts:
I've just created a module that concerns books (add book, edit books, etc). Of course the administrator can use it, but I want to allow users that are connected to use it as well. But with condition on uid like so:

User1: add book 1, book 5, book 7
User2: add book 3
...

The administrator can see all books (1,3,5,7) (that's done). But user1 (which is not superuser user/1 ...) has to only see his/her books (1,5,7), and similar for user2.

I'm sure I have to add a condition on my current module like:

if (uid = current user id) then show only user1's books)

But how to do that?

I know that the table "node" contains both informations of user id and nid (all books).

Note: I want to do that without using the Views module.


texts: How do I show the weather block based on Geofield on a Taxonomy Term

texts:
The Weather module has a block to show weather based on IPs on a node defined by the geofield module. There doesn't seem to support if it is on a taxonomy term. How can I modify this code to support taxonomy terms?

   case 'geofield':
  if (user_access('access content')) {
    // Set up the node geofield weather block.
    if (arg(0) == 'node' and is_numeric(arg(1))) {
      $node = node_load(arg(1));
      $block['subject'] = t('Weather nearby');
      $block['content'] = '';
      $display = weather_get_display_config('default');
      $display->detailed = FALSE;
      // Get a list of all field names which are geofield fields.
      $geofield_field_names = db_select('field_config', 'fc')
        ->fields('fc', array('field_name'))
        ->condition('type', 'geofield', '=')
        ->execute()
        ->fetchCol();
      foreach ($geofield_field_names as $geofield_field_name) {
        if (isset($node->$geofield_field_name)) {
          // The node has geofield fields, determine if there's usable data.
          // First cycle through the language codes (will mostly be 'und').
          foreach ($node->$geofield_field_name as $language) {
            // Now cycle through the different locations.
            foreach ($language as $location) {
              if (($location['lat'] != 0) or ($location['lon'] != 0)) {
                $place = weather_get_nearest_station($location['lat'], $location['lon']);
                $forecasts = weather_get_weather($place->geoid, $forecast_days, $display->detailed);
                $weather[0]['forecasts'] = $forecasts['forecasts'];
                $weather[0]['utc_offset'] = $forecasts['utc_offset'];
                $weather[0]['name'] = $place->displayed_name;
                $weather[0]['geoid'] = $place->geoid;
                $link = _weather_get_link_for_geoid($place->geoid, 'default');
                $weather[0]['link'] = l($place->displayed_name, $link);
                $link = _weather_get_link_for_geoid($place->geoid, 'yr.no');
                $weather[0]['yr.no'] = $link;
                $weather[0]['station'] = array('distance' => $place->distance, 'bearing' => $place->bearing);
                $block['content'] = theme('weather_forecast_preprocess',
                  array('weather' => $weather, 'display' => $display));
              }
            }
          }
        }
      }
      // Do not show block if no lat/long information has been found.
      if (empty($block['content'])) {
        return;
      }
    }
  }


texts: Pass exposed filters values from one view to another view

texts:
I have a view that lists some nodes, has some exposed filters, like countries and search and a registered path without any contextual filters.

I also have a second view with the same exact exposed filters, but with a different registered path, again without any contextual filters.

At the first view I have a link that points to that second view.

The question is how can I pass the filters values (if any) selected from the first view to that second view when I click to the link of the first view?

After trying some things didn't managed to solve that but only by using the $_SESSION variable, however I'm not sure how optimal is this?!


texts:
Let's say a user is registered and posts a comment to a node but didn't like the comment so he/she wants to edit it. I would like to limit the amount of time the user has to edit the comment. After this time has elapsed they should not have the ability to edit the comment, only they will need to contact an admin to do that.

How would I implement this or is there a module to help me accomplish this.


texts: Alter comment pager to jump to comment section right away?

texts:
I set up a content type and a specific comment type for this content. I set the comment pager to display 10 comments per page. When I now use the pager, I get redirected from the node URL itself www.domain.com/node/1, to www.domain.com/node/1?page=1.
Is there any possibility to add an ID to the URL for the comments pager only, for example www.domain.com/node/1?page=1#comments?
I want to do this, so the user doesn't need to scroll over the whole content of the node again, just to get to the second comments page. Instead, I want to jump to the comment section right away.
Is there any elegant way to do so? A module that does it, or similar? I already thought of altering the pager.html.twig in my theme. But then I would alter the node pager as well.
Thank you very much in advance for pointing me any way to achieve this.


texts: Views "Load More" replacing results instead of appending

texts:
Views load more is replacing the results rather than appending those below the existing ones.

I am using block for content listing and need a append more option to load more content below the existing one. I tried views show more and views load more extensions.


texts: how to apply 'noindex' to all nodes and leave Alias indexable to prevent perceived duplicates for SEO

texts:
We're working with an SEO specialist who is finding that our underlying /node/### page URLs are competing with our aliases and bringing our page ranking, etcetera down - because they're perceived as duplicate content. (Drupal 8)
I'm looking at anything that is out there, but not sure if any of these cover what I need. Is there a simple way to set all urls containing /node/* to noindex, nofollow? Maybe a way in robots.txt?
Would simply adding this to robots.txt work?
Disallow: /node/*

As a side question, what are the ramifications of making such a change? Any issues I need to be aware of, protect against?
Or maybe there's another way people have solved this problem?


texts: Add product variations to product display with rules

texts:
Using RULES, can anyone point me in the right direction to add lots of product variations to existing product displays?

Everything I've researched seems to be centered around creating the display when the variation is created or vice versa.

In a nutshell, my customer has created the product displays and I've setup VBO to create all the product variations. However I can't find a way to add all my particular variations to a particular display unless I either use the "Product Display Manager" module (which doesn't appear to support Bulk Operations), or add the variations one by one via the "Inline Entity Form". We'll be talking about 1000's of variations in the end.

I am a novice at RULES but it's cool to use, so ideally I would like to be able to create a RULE called, "Add variations to display". which would be available on the this page:

admin/commerce/products/variations

where I can:

1/ Select the variation checkboxes
2/ Choose the rule
3/ Click APPLY
4/ Have the rule ask me which product display the selected variations should be applied to (Ideally a list of display TITLES)
5/ Then save that product display once complete (I should be able to do that bit in the rule from what I have read)

Love to hear if someone has been able to do this or at least point me to where I can follow instructions specific to my issue. But I have a sneaky suspicion that it can't be done like this, otherwise I would have found a solution already.

Cheers


texts:
I can create articles via REST without problems. But I can not figure out how to submit files.

How do I submit files (images) to Drupal 8 via REST?

Update:

REST UI - File: /file/{id}

Example image added in article:
/admin/content/files -> /admin/content/files/usage/1

file {id} = 1?

Get file id 1:

curl --request GET --user admin:admin --header 'Accept: application/hal+json' http://d8.local/file/1
A fatal error occurred: No route found for "GET /file/1"

Post image (without entity content):

curl --request POST --user admin:admin --header 'Content-type: application/hal+json' http://d8.local/entity/file
{"error":"No entity content received."}

I can't find out how to create the entity content.


texts:
I have a simple 2 level menu like this:

Category1
   Link1a
   Link1b
   Link1c
Category2
   Link2a
   Link2b
   Link2c

I'd like to create a tabbed Menu/Submenu for this: When Category1 or any of it's sublinks are selected (clicked) Category1 is "active" and its links are shown. Category2 is visible but its links are not:

tabbed menu http://xooplate.com/assets/template/9845/p16qeq63ber8n2agm6hf8p2kb9-details.jpg
(random example from the web)

Can anybody point me in the right direction?


texts: Create text search block on home page leading to faceted search view?

texts:
This seems like an easy question that seems still unanswered. I have a faceted search in Views. Works nicely. All I want to do is:

Create a text field search in a block (can be anywhere, can just use  in a block config for the home page, yes.)
Send that text field search right into the faceted search View page.

Seems simple enough and I'm sure many have wanted to do the same? Can anyone help me connect the Drupal dots? Thank you in advance.


texts: Form Display: How to move elements out of the advanced container?

texts:
I want to tweak the node add/edit form for one of my content-types and rearrange the fields in different groups.

I use the Field Group Module to setup the different groups.

On the Manage Form Display settings of the content-type I rearrange the Fields, which works fine for all fields but "Authored by", "Promoted to front page" and so on. All this fields are rendered in an "advanced" container, no matter what.

This is also part of the classy theme file node-edit-form.html.twig

    {{ form|without('advanced', 'actions') }}

    {{ form.advanced }}

Is there any way to break this up, so I can move the containing fields into different groups, just like any other field?


texts: How to remove the default "Anonymous" from comment author name?

texts:
In the comment form field (core comment module) I would to leave the comment author name empty, in order to encourage commentators to come up with original epithets.

What's the easiest way to do it?


texts: I was just wondering if there was any module that implements the stripe api for payment processing. I'm using drupal 7. Stripe is a new payment processor that people say is better than paypal so I'd like to try them out. they're at stripe dot com


texts:
I'm currently working on a simple reviewing system. I've created a custom comments type ("Review") with an integer list ("Rating") that can be added to my nodes. Now, while displaying the note, I would like to get an average rating based on the reviews posted.

I am quite new to Drupal, and I thought that I might achieve this by creating a custom twig template for the product-type nodes and getting the required value in a preprocess function.

I succeeded in getting the field_reviews object with

$variables['comment_field'] = $node->get('field_reviews');

and when I kint()ed it out, I got a really big file structure, but the required data was in there.

However, whenever I tried following the path down there through dozens of variables and arrays, when I reached the review itself, kinting yielded NULL or the page didn't load at all.

I'm getting the feeling that this approach is not ideal and that I must've overlooked something much easier, but I can't seem to figure out what.


texts: What's best practice when working with the language[und]?

texts:
I'm starting to use this form to access data in my module. (See comment #1.)

$node->field_test[$node->language][0]['value']

I thought that looked like a pretty good solution, but further down that same question I found this:

  Don't assume that 'und' is for fields of entities without language, it is also for fields that are not translatable, and without the entity translation module that is all fields. Moreover, there are differences in this between the various 7.x versions of Drupal.
  Better to use the field_get_items() function which will sort out for you under what language code the data is stored.

And now I don't know if what I'm using could break something down the road.


texts: View that link to content in other languages

texts:
I have a multilingual site where some content types are translated, and others will remain English only. I'd like to have lists of English content on other language sites. I've created a view that will list content from types that can not be translated, but the path variable is putting forward a translated link (e.g. /fr/node/123) even though it doesn't exist.

How do I get the link to the English version? If i have the node title "Link this field to the original piece of content " it links to the URL i am expecting, but I can't use that in rewriting...


texts: Does a Context Condition Path need to exist?

texts:
I have a context that has a condition Path of FooBar/*
I added a block (Reaction) view for that context.
When I go to /FooBar/Mens_Bible_Studies, the view shows, but I also get "Page not found"?

Page not found

    Mens Bible Studies

    Overview of Mens Bible Studies. Delete if you don't want an overview
        Curabitur tortor - Meets every Wednesday, 6:30 am.

The requested page "/FooBar/Mens_Bible_Studies" could not be found.

What am I missing?

Rich

Update based upon the first two responses.

Thanks Boriana and rooby for answering! Here is a little more about what I am doing. At this point I am really not sure why I didn't use a page view. I am leaning to using contexts instead of panels. I want a responsive site and the theme handles that for me so I don't want to force a layout with panels. I want to select my block view based upon the "FooBar" root path.
I have a fairly large number of content types tagged with different taxonomy terms. I have a compound view that does all the work. It just looks at the last leaf of the URL (/FooBar/bla1/bla2/blanN... there is a variable depth) and uses that as the taxonomy term and builds a recursive output that descends the taxonomy tree in a way that I can CSS style each level differently. Content tagged as sub-category heading displays differently than content tagged with terminal terms (the lowest level in the branch of the taxonomy hierarchy they are in). I have heading content and then child content under that in the term hierarchy.
I thought I could just have the reaction point to the view and have it output. I will try both approaches you both suggested to see what works best. I believe I have to go with rooby's suggestion since I don't think I can have menu entries point to non-existent content. After I posted, I was thinking of just creating a panel page with empty variants that reacted to all the URLs I needed to create. Each of these would point to the same block view.

So Ideally, the new module I would need create (I never created a module before) would take a list of my hierarchical URLs, create phantom pages for them and create menu entries for them. My context would provide the content.

Or, perhaps I should just commandeer the taxonomy term views with what I want since the URLs that I want match the taxonomy term hierarchy.


texts: The directory tmp does not exist and could not be created

texts:
I keep getting this error since updating to Drupal 7.5.8 and cannot get rid of it regardless of trying all I know. Even adding it / copying-pasting the previous tmp dir or changing the tmp file name (eg tmp3) doesn't solve it.  Any files placed in the directory are writable unless I need to add a new Drupal 'group' in security.

Any one know how to solve this update issue?


texts: How to disable auto submit on value change in date_popup form?

texts:
Is there a quick way how to disable auto submit on value change in date_popup forms?

Thanks.


texts: adding meta info to contents and filter them

texts:
the target is to be add a meta field for drupal custom content type. that meta tag should be selectable by user when adding a new article .

the meta field is meant for language . (e.g. English / Urdu). the content types should show which  belong to the specific meta tag. e.g. if user selects English then the articles marked with english meta tag show up only.

any help appreciated


texts: Sharing article to facebook adds reserved html characters in heading (&amp #039)

texts: I have a drupal 7 site, and after sharing posts to facebook, I saw strange behaviour. When I use quotes in heading, after sharing the article i see '"e; and #039, what causes this and how can I avoid it? I use addtoany drupal7 module.


texts:
I just found out the template for themeing the register page is page-user-register.tpl.php.

But, how do I change the labels on the textfields etc?

For instance, I want to rename the E-Mail label to ... somethingelse :-)


texts:
The above image is from Views Table. The values inside Name is title field so it is clickable by default and links to its Node. I want to make the values inside Nick Name and Age clickable link too, which will go to the same Node as its title.

I went to Nick Name field and did Rewrite Result and Output this field as a link, but in Replacement Patterns there is no Token for link, still I tried with [title], [title:url], [path], [view_node], etc.  but it cannot be linked to its Node.


texts: Integrating file management with Organic Groups

texts:
Using Drupal 7 and OG 2.x. I'm looking for a file manager to use so that each group has a files tab with the ability to create, move, delete files/folders for their group and read/write permission is only for the members of the specific group.

Is filedepot the only module for this? I have found elfinder, CKFinder, and IMCE, but it's unclear whether these are reasonably simply to integrate with OG.

Has anyone integrated a specific file manager with OG and is happy with how it's working?


texts: Display custom user profile field as name in articles

texts:
I would like to display the custom user profile field name as the author's name in articles, instead of the user's username. How can I do this without modifying code of my template or Drupal itself?

I saw solutions for Drupal 7 but I'm using Drupal 8. I found custom modules for Drupal 7 or earlier and code modification ways. Both seems wrong to me because the mentioned modules aren't updated nor it feels correctly to me to change code to achieve this quite basic task.


texts:
I have created a view using custom content type with edit link.I have to write some php code for edit link.Can i override views_handler_field_node_link_edit extends in my custom module?

    /**
     * Renders the link.
     */
    class views_handler_field_node_link_edit extends views_handler_field_node_link {
        function render_link($node, $values) {
        // Ensure user has access to edit this node.
            if (!node_access('update', $node)) {
                return;
            }

            $this->options['alter']['make_link'] = TRUE;
            $this->options['alter']['path'] = "node/$node->nid/edit";
            $this->options['alter']['query'] = drupal_get_destination();

            $text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
            return $text;
        }

    }


texts: Is it possible to expose custom table data to Views without custom code?

texts: I have a custom table that I'd like to expose to administrators so that they can perform simple searches on the table data. I know I can create a series of custom views handlers for each field, but is there is a way to expose and search through the custom table data without custom coding? I expect there is a contrib module out there that solves this problem, but my Googling has come up dry.


texts: How to use contexual filters for registration events?

texts:
I want to create a block on the side of the page that will show registered users to a event. I already have a event type and calendar system + a registration system.

When a user registers for a event, I can get the view to display it. However, it is displaying literally ALL registration users for ALL events. I am trying to get the contextual filter to just narrow it down to the specific event, but cannot get it to work.

Any help?


texts:
I would like to reproduce drupal.org search.
I know that is used the Apache Solr module.What I don't know is how to make appear the available selections like Module,Themes,All,Groups etc so as to filter only these.
How can I do this?
Thanks


texts:
In Drupal 7, in admin/structure/menu/settings we have the main links and the secondary links.

Can we add third one here? Is there any way to get the list of all menus created in backend?


texts: why &drupal_static is getting used with refernce?

texts: I am going through different modules and I found this &drupal_static function but exactly dont know why is getting used can any one please explain what is the purpose ?


texts: Drupal 7 + Services 3 : anonymous user can't access user/register endpoint (401 access denied)

texts:
I'm using Services for providing an external webapp to register new user to the Drupal server.

I'm able to login from the webapp, create node and post comment.

But I can't have access to user registration.

My endpoint is configured and got all CRUD functionnality for user checked.

But when I try to acces it : http://localhost/rest/user/register

I got a 401 : ["Access denied for user anonymous"]

I guess I'm missing sone permissions, but I can't figure out which one ?

Could you please help me ?

Thanks in advance.

nieud


texts: /sites/default/files images not showing up

texts:
This is for a Drupal 6 site, but I've seen this problem with Drupal 7 before too.

I migrated my site from a main domain (www.domain.org, let's say), to a development domain, with a subdirectory, (www.devlin.domain2.com/domainupgrade).

That breaks the images located in /sites/default/files, but not the files located in /sites/all/themes/themename

How can I fix this? I've tried changing file permissions (shot in the dark) as well as the base url setting (but I perhaps didn't change it to the correct value?)

How can I get images to show up in this context on the development site?


texts:
I am using PathAuto to redirect user urls to the following pattern. users/[user:name].

I have created a page using the views module which needs to show up as a tab on the user naviagation menu. Currently the PATH property for the page is set to /user/%/seasons.

Here is my issue.

My account is Uid=1, UserName = 'Declan'.

Pathauto renders that as '/users/declan' - which is what I want.

When I click on the 'Seasons' tab, the page is rendered, but the url is '/user/1/seasons'.

Is there any way to rewrite the PATH property in the view such that is will render '/users/declan/seasons'?


texts:
I just update a site from Drupal 7.14 to Drupal 7.15 and made some other modules updates.

One of the content I have created in the site is Inmuebles

The site have around 200 nodes of the Inmueble type. All of them are shown fine. But if I tried to edit them I get a blank page (nothing at all).

I tried to Edit the content type Inmueble itself and I get a blank page.

I tried to Manage the Fields and I get a blank page.

I have no problems with other content types, just with this one.

I guess this content type has a mis-configuration but I see no way to fix it if I can't access to modify it.

If I delete the content type because I will delete the nodes as well, then I can't do that.

What can I do? I have Drush installed, just in case it helps to fix this.

UPDATE

Found the problem (but not the source of the problem)
It was a problem of memory size. I had to set the memory size to 512 to get the content type loaded. But this is not normal anyway. The page takes 1 minute to load... and why does this content type need this much memory to work fine. How can I fix this?

I enabled  Display query log , Display memory usage and Display memory usage
Now if I edit a node I get this summary report:

  Executed 731 queries in 555.96 ms. Queries exceeding 5 ms are
  highlighted. Page execution time was 3058.65 ms. Memory used at:
  devel_boot()=2.08 MB, devel_shutdown()=135.13 MB, PHP peak=137.25 MB.


texts: Status on node is not changed during query update

texts:
I'm updating a node's status to unpublished and the status in node_field_data is changed from 1 to 0 but in the content view, status is published and when editing the node, the publish checkbox is still checked.

What am I missing?

Drupal::database()->update('node_field_data')
->condition('nid', $nids, 'IN')
->fields(['status' => NodeInterface::NOT_PUBLISHED])
->execute();


texts: How to update table taxonomy_index when adding a node referencing a term?

texts:
I have two node types: Lesson and Exercise. A lesson contains several exercises, which are children. Lessons have a category field which is a reference field of type taxonomy term. Exercises point to lessons through a Lesson reference field, which I suppose indirectly maps exercises to terms.

When I create a lesson, I use the following code:

    $node = Node::create([
      // The node entity bundle.
      'type' => 'lesson',
      'langcode' => 'en',
      'created' => $lesson->created,
      'changed' => $lesson->changed,
      'uid' => $lesson->uid,
      'title' => $lesson->title,
      'field_category' => $tid,
      'body' => [
        'summary' => $lesson->summary,
        'value' => $lesson->body,
        'format' => 'full_html',
      ],
    ]);
    $node->save();

Note the field_category field.

The above does not result in the taxonomy_index table being updated. I could update it with an sql query, but I would like to know how to do it via the above core approach.

And for the Exercise node type, I suppose I need to do likewise, unless my linking of an Exercise to a Lesson already accomplishes the hierarchy.

How do I alter the above to result in the taxonomy_index table being updated?


texts: Set trim_length of field through UI for blog entries

texts:
I am using the Blog module, but don't like the 600 character trim length.  I want 2000 char.

But, I can't find out where to change this in the admin console.

I was able to update the trim length through the mysql console, but this seems less than ideal.

The code below was how I was able to complete the config change.  How can i do this without a SQL update?

mysql> select * from field_config_instance where id=9\G
*************************** 1. row ***************************
         id: 9
   field_id: 2
 field_name: body
entity_type: node
     bundle: blog
       data: a:6:{s:5:"label";s:4:"Body";s:6:"widget";a:4:{s:4:"type";s:26:"text_textarea_with_summary";s:8:"settings";a:2:{s:4:"rows";i:20;s:12:"summary_rows";i:5;}s:6:"weight";i:31;s:6:"module";s:4:"text";}s:8:"settings";a:3:{s:15:"display_summary";b:1;s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:7:"display";a:2:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:0;}s:6:"teaser";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:23:"text_summary_or_trimmed";s:8:"settings";a:1:{s:11:"trim_length";i:600;}s:6:"module";s:4:"text";s:6:"weight";i:0;}}s:8:"required";b:0;s:11:"description";s:0:"";}
    deleted: 0
1 row in set (0.00 sec)

mysql> update field_config_instance set data='a:6:{s:5:"label";s:4:"Body";s:6:"widget";a:4:{s:4:"type";s:26:"text_textarea_with_summary";s:8:"settings";a:2:{s:4:"rows";i:20;s:12:"summary_rows";i:5;}s:6:"weight";i:31;s:6:"module";s:4:"text";}s:8:"settings";a:3:{s:15:"display_summary";b:1;s:15:"text_processing";i:1;s:18:"user_register_form";b:0;}s:7:"display";a:2:{s:7:"default";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:12:"text_default";s:8:"settings";a:0:{}s:6:"module";s:4:"text";s:6:"weight";i:0;}s:6:"teaser";a:5:{s:5:"label";s:6:"hidden";s:4:"type";s:23:"text_summary_or_trimmed";s:8:"settings";a:1:{s:11:"trim_length";i:3000;}s:6:"module";s:4:"text";s:6:"weight";i:0;}}s:8:"required";b:0;s:11:"description";s:0:"";}'
    -> where id=9;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0`


texts:
In Drupal 6, I have a custom form validation function, where:

I copy the value from field A to field B, if field B is empty.
I call form_set_error() when the field B contains more than X characters.

Validation works fine, and the error is set. The problem is that the value in field B is not retained when the form is rebuilt: field B remains empty. I want to keep the value in field B after validation (when the error is set) to make it easy for users to edit it down to the right length.

My validation function looks like this:

function myform_validate($form, &$form_state) {
  if (empty($form_state['values']['field_b']['0']['value'])) {
        $form_state['values']['field_b']['0']['value'] = $form_state['values']['field_a']['0']['value'];
      }
      if (strlen($form_state['values']['field_b']['0']['value']) > 260) {
        form_set_error('field_b', 'Text in field b is too long');
      }
    }
  }
}

Any suggestions on how to retain the value in field B when the form is rebuilt?


texts: Set URL Fragment based on which Vertical Tab clicked?

texts:
Would it be possible for me to have the URL of a given page change depending on what Vertical Tab the user clicks on the page?

For example, when a user is on a complex node form on my site, there are many tabs, each one providing a separate group of information about the node. I'd like for the user to be able to click on a link inside one of the fieldsets, and be able to click the back button to jump straight back into the fieldset he was viewing previously.

Right now, since the fragment isn't in the URL, the user is always brought back to the first vertical tab, regardless of which was open when a link was opened.

If I manually enter the fragment of the #id of the vertical tab that should be opened (like example.com/node/200/edit#my-vertical-tab-id), that works. Is there a simple way to make it so that when a user clicks on a vertical tab, it's anchor fragment is appended to the end of the URL?


texts:
I'm trying to edit a user, but I keep getting the following error:

  The email address [their email] is already taken.

I'm not editing their email. In fact, I could open the edit page, just hit Save without changing anything, and I would still get the error.

Why am I getting this error message?


texts: How to display JSON returned (from external REST API) in a Block? [my code attempt inside]

texts:
I am trying to display the data from a REST API (URL: 'http://api.kivaws.org/v1/loans/38239/lenders.json') to display in a block. Below is my code. It is not working, any hint on why will be sincerely appreciated.

/**
 * Implements hook_block_info().
 */
function restapiexample_block_info() {
  // This example comes from node.module.
  $blocks['kiva'] = array(
  'info' => t('Kiva Test Block'),
  'cache' => DRUPAL_NO_CACHE
);

return $blocks;
}

/**
 * Implements hook_block_view().
 */
function restapiexample_block_view($delta = '') {
// This example is adapted from node.module.
$block = array();

switch ($delta) {
  case 'kiva':
    $block['subject'] = t('Kiva Example');
    $block['content'] = array(
    '#theme'  =>  'page',
    '#markup' =>  kiva_list_loans(),
  break;
}
return $block;

}

function kiva_list_loans() {
  $request = drupal_http_request('http://api.kivaws.org/v1/loans/38239/lenders.json');
  return drupal_json_decode($request->data);
}

You can try the URL, good JSON data is being returned. Error I receive is several instances of the following text in the $messages area: "Warning: Cannot use a scalar value as an array in drupal_render() (line 5859 of /home/drupalpro/websites/example7.dev/includes/common.inc)"

UPDATE 1:
With help from comments/answer below, I made some progress. from my function "kiva_list_loans()", I am able to see the response in my $page array. I changed the '#theme' in my "$block['content']" in hook_block_view to 'page' - but still I only see the word "Array". How to get this to render?


texts: Alphabetical case insensitive grouping of results

texts: My question is about grouping results alphabetically in a case insensitive way in Drupal 8. I have a view displaying people's names alphabetically grouped by last name. My problem is the following: I have some people with last name that starts with upper case D and other whose last name starts with lower case d (Example: de XXX). Right now the upper case D and the lower case d are grouped separately. I need to be able to group them together.


texts: Creating an entity with an unlimited number of bundles

texts:
So I want to create an entity that can have as many user-created fieldable bundles as possible.

My first thought was to look at the Profile2 module, however I notice that there appear to be two separate entities as part of it - the profile2 entity, as well as a profile2_type.

  // Add bundle info but bypass entity_load() as we cannot use it here.
  $types = db_select('profile_type', 'p')
    ->fields('p')
    ->execute()
    ->fetchAllAssoc('type');

  foreach ($types as $type => $info) {
    $return['profile2']['bundles'][$type] = array(
      'label' => $info->label,
      'admin' => array(
        'path' => 'admin/structure/profiles/manage/%profile2_type',
        'real path' => 'admin/structure/profiles/manage/' . $type,
        'bundle argument' => 4,
        'access arguments' => array('administer profiles'),
      ),
    );
  }

I want to have separate entities with only one instance, but unlimited bundles. Do I need to create two separate tables to accomplish this, or should it be possible with one table? I think it should be possible, but I'm not quite sure.


texts:
In the ancient times when things were easy, you just had to code a form in html and then your php would typically have a if($_REQUEST['some_value']) to handle the request. But now with Drupal, nothing is easy... Here is once more my latest battle to understand how Drupal thinks.

Context: I have a list of news (content type "news") shown on a page with paging system. Each news title links to the news details page. This works fine. There is a new requirement that each news must have one or more "tags". The goal is to show a list of checkboxes on top of the news list to allow the user to filter in/out news with the selected tags.

EDIT: After being defeated by Drupal's form I decided to completely bypass the Form API and generate my own fully flexible form.

There is only one thing remaining, Drupal is forcing some div wrappers around each of my input fields. I want to get rid of them (and stop Drupal to think at my place).

In my_news_list.tpl.php I coded:

<form action="" method="post">
<?php
foreach($tags as $tag){
    ?><input type="checkbox" name="tags[]"
        value="<?php echo $tag['id'] ?>"
        onchange="form.submit();"
        <?php if(isset($tag['checked'])){?>checked="checked"<?php }?>
      /><?php echo $tag['value'] ?><?php
}
?>
</form>

Result(!):

<form action="" method="post">

        <input type="checkbox" name="tags[]" value="15" onchange="form.submit();">

    Acquisitions

        <input type="checkbox" name="tags[]" value="14" onchange="form.submit();">

    Corporate

        <input type="checkbox" name="tags[]" value="18" onchange="form.submit();">

    Investor News

        <input type="checkbox" name="tags[]" value="16" onchange="form.submit();">

    Products and Services
</form>


texts: Content type permissions are not working

texts:
I'm trying to give users permission to edit certain content types, but it's not working. I'm having trouble tracking down which module could be the culprit. (I've used a couple of beta modules)

How should I go about tracking down this problem?


texts:
I used Login Security module to block users after some login failures. It works fine however I need to unblock such users after certain time like after 1 hour/day. How would I do that as it has configurations to delete attempt from database but user isn't unblocked and it has to be active manually.

Please see below attached screen shot of module configuration.


texts: Remember webform textfield for next entry

texts:
I would like to know what is module to remember webform textfield or select option, so once fill in or selected, the next entry use the previous entry. In webfform autocomplete, typing several characters still required.

Is that possible to do that?


texts: Why can I not enable or disable views in admin/structure/views?

texts:
When enabling/disabling a view in the Administration/Structure/Views section I get an error:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /?q=admin/structure/views/view/archive/preview/default/ajax
StatusText: Internal Server Error

I get a similar error when clicking Edit but I am granted access to the edit page where I can complete the task at hand.

Found a sort-of-workaround to Enable a disabled view. After clicking Enable and closing the error popup, I then clicked Edit, closed the new error popup then changed the field "Use AJAX:" to 'Yes' and Saved the changes. Lo and behold, the viewed was Enabled.

Doesn't work when attempting to Disable the view however.

Any ideas would be gratefully received.


texts: How can I select a user role at the time of the account registration?

texts: How can I show the field to let users choose the role when they register an account on Drupal 8?


texts:
I'm trying to disable or delete the Relation module (and about to pull what's left of my hair out).

Relation and Relation Endpoints Field are checked, but greyed out so I can't uncheck them. I don't see anything that's dependant on these, and I don't see anything in the Field List related to this module.

All of the other Relation modules (Relation Dummy Fields, etc) have been uninstalled and I've run cron 40 or 50 times as well as

DELETE FROM field_config WHERE field_config.deleted = 1;

which someone suggested on another post on the topic, but no success.

The reason I'm trying to delete Relation is that I'm trying to update Drupal core from 7.28 to 7.36 (long story) and getting an unresolved dependency as Relation isn't compatible with 7.28.  Someone suggested I disable the module before doing the update, and I'm trying to do that.  However, I'm wondering if per-chance this problem has to do with the incompatibility.

I don't seem to be able to move forward or back and I'm not sure what to try next.

Currently:
Drupal 7.28
Relation 7.x-1.0-rc7


texts: How to assign credit hours to user account once the content is marked completed by admin

texts:
I have a custom content type "course" and it has an entity reference to username. ( the username is basically an instructor who is suppose to teach the course )

I have created a field "Course Completed" in course content type and admin changes it to "completed" manually. The content type also has a filed "Number of hours"

What i need is, when the node is marked as completed, the "Number of hours" is taken from node and added  to user account.  ( i can create a field using profile2 and name it as "user credit hours")

How would i do this? is there any module which will work similar to what is needed  ?

thanks


texts: why i can't write anything to a custom cache table?

texts:
First in mymodule.install I declared mymodule_schema(hook_schema) mymodule_install() and mymodule_unistall()

Where mymodule_schema() is like this:

function mymodule_schema() {
    $schema = array();
    $schema['cache_mymodule'] = drupal_get_schema_unprocessed('system', 'cache');
    return $schema;
}

this worked perfectly and table cache_mymodule with the same structue as table cache was created.But in my code, using this:

$cid=some_calcuated_cid();
$cache=cache_get($cid,'cache_mymodule');
if (!$cache){
    $data = some_calcuated_data();
    cache_set($cid,$data,'cache_mymodule');
    dpm('CACHE SET');
else {
    dpm('used cache');
}

I always get 'CACHE SET', Now if i change 'cache_mymodule' to just cache, Or remove it, It works perfectly (saying used cache), Am I missing some hook in mymodule?


texts: Hide user fields on profile2 registration form

texts:
I am working on multi-user website with 3 roles in Drupal 7 website. I'm using profile2 module for custom fields for different users, also profile2 path for profile/user registration.

Problem came up with Location module because I need 3 different location cck (different fields from location cck are allowed) fields from every user/profile role. I got stuck with this more than 2 months. It would be nice that I can use Profile2 and Location cck but it's not possible because Views module does not extract different Location fields for my Profile2 CCK fields in different profiles (for example I need only phone or city field from location in some view).

The only way to achieve this (so far) is to make 3 location cck fields in user account fields and with field permission module grant privileges for specific roles.

But! I need to expose that location fields on profile2 registration paths with all other fields from specific profile and they need to be required.

Is there a way to hide location cck fields on the registration form based on user type (buyer, seller, etc)?


texts:
i just install the coder and when i run:

drush drupalcs .

in my module folder i got the next errors what i must do in order to avoid these errors??

PHP Warning:  simplexml_load_file(): /home/giannis/.drush/coder/coder_sniffer/Drupal:1: parser error : Document is empty in /usr/share/php/PHP/CodeSniffer.php on line 531
PHP Warning:  simplexml_load_file():  in /usr/share/php/PHP/CodeSniffer.php on line 531
PHP Warning:  simplexml_load_file(): ^ in /usr/share/php/PHP/CodeSniffer.php on line 531
PHP Warning:  simplexml_load_file(): /home/giannis/.drush/coder/coder_sniffer/Drupal:1: parser error : Start tag expected, '<' not found in /usr/share/php/PHP/CodeSniffer.php on line 531
PHP Warning:  simplexml_load_file():  in /usr/share/php/PHP/CodeSniffer.php on line 531
PHP Warning:  simplexml_load_file(): ^ in /usr/share/php/PHP/CodeSniffer.php on line 531
PHP Fatal error:  Uncaught exception 'PHP_CodeSniffer_Exception' with message 'Ruleset /home/giannis/.drush/coder/coder_sniffer/Drupal is not valid' in /usr/share/php/PHP/CodeSniffer.php:533
Stack trace:
#0 /usr/share/php/PHP/CodeSniffer.php(419): PHP_CodeSniffer->processRuleset('/home/giannis/....')
#1 /usr/share/php/PHP/CodeSniffer/CLI.php(614): PHP_CodeSniffer->process(Array, Array, Array, false)
#2 /usr/bin/phpcs(37): PHP_CodeSniffer_CLI->process()
#3 {main}
  thrown in /usr/share/php/PHP/CodeSniffer.php on line 533
PHP_CodeSniffer found at least one issue.                                                                                [error]


texts: Make Backup & Migrate backups smaller in size

texts:
I have a 2MB upload cap on my school's server and get an error from backup and migrate that it cannot restore the file.

Is there any way the backups from backup and migrate module be compressed in some way and upload them when are needed?

I often take a backup before making new changes on the site and revert to the last one if I make a mistake or get an error, so ideally all files(DB and Directory) need to still be backed up...


texts: How to get Taxonomy Term Field Value in twig

texts: I have a taxonomy term with the name 'Colors' and it has 1 image field called field_color_image. In my project I have a node type with a field type of Taxonomy term that refer to Colors. My aim is that I want to show the image in the Colors taxonomy to a node. I already used kint and it didn't really help. How do I achieve this? Thank you beforehand.


texts: Adding 'Add to Cart' to 'Collection Products' view

texts:
I want to add an Add to Cart button to my products when they are still in the Collection Products view (Category overview). By default, when you navigate to a category like /commerce_kickstart/product-category/sample-category-1, you will find the single products display like this:

I would like to have all of the single products be shown like this:

In the Product Display content type, the add-to-cart-form is stored in $content variable. It is pretty easy to access via field_productand I can for example add multiple forms and stuff. But how can I get the form in the Collections Product view?
I went to Structure -> Views -> Collection Products -> Field and looked through the available fields. I found field_product but when I add this, everthing that changes is that a link to the product is shown underneath the price.

So how can I add this to the Category overview?

Edit:

I have added this field (because the name appeared to be familiar scince the cart form is stored in this variable (field_product) in node--product_display

https: //i.stack.imgur.com/CaNo9.png

And that caused this to appear, wich only adds a link to the product underneath the price.

https: //i.stack.imgur.com/1vbWW.png

And this is basically all the configuration besides some more irrelevant stuff:

https: //i.stack.imgur.com/fk9BB.png


texts:
namespace Drupal\my_block\Plugin\Condition;

use Drupal\Core\Condition\ConditionPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Provides a 'Company' condition.
*
* @Condition(
*   id = "company",
*   label = @Translation("Company"),
*   context = {
*     "company" = @ContextDefinition("company", label =   @Translation("Company"))
*   }
* )
*
*/
class Company extends ConditionPluginBase implements ContainerFactoryPluginInterface {
  private $request;
  public function __construct(\Symfony\Component\HttpFoundation\RequestStack $request, array $configuration, $plugin_id, $plugin_definition) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->request = $request->getCurrentRequest();
  }
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
    $container->get('request_stack'), $configuration, $plugin_id, $plugin_definition
    );
  }
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $company_options = [0 => "COM1", 1 => "COM2", 2 => "COM3"];
    $form['company'] = array(
      '#type' => 'checkboxes',
      '#title' => $this->t('Company selection'),
      '#default_value' => $this->configuration['company'],
      '#options' => $company_options,
      '#description' => $this->t('Select company to enforce. If none are selected, all companies will be allowed.'),
    );
    return $form;
  //return parent::buildConfigurationForm($form, $form_state);
  }
    public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    $this->configuration['company'] = array_filter($form_state->getValue('company'));
    parent::submitConfigurationForm($form, $form_state);
  }

  public function summary() {
    return t('This is a summary');
  }

  public function evaluate() {
    return TRUE;
  }
}

The evaluate function keeps returning false(my guess). Since when I enable the context in the block the block disappears no matter what. Even though my evaluate function returns TRUE. Any idea what's wrong here?
I've taken this from the Language condition implementation.


texts: Fetch content from another website into a new one

texts:
I want to fetch content from a website into another website. When I edit that content, it will automatically display changes. I am using Drupal 6.

Does anybody have an idea about I can achieve this?


texts: The uploaded file likely exceeded the maximum file size (32 MB) that this server supports on remove image

texts:
In my taxonomy terms,when I try to edit a term I got this error :

  An unrecoverable error occurred. The uploaded file likely exceeded the
  maximum file size (32 MB) that this server supports.

even though I didn't try to upload a file,I tried to remove the uploaded file.
and I don't have mod_security module enable on my server .( as I search through google,there was problem with mod_security apache module and ajax).

I have no idea why this is happening only on particular vocab terms,not in anywhere else.


texts: Adding links to EntityForms on submission confirmation page

texts:
I'm working on a site that has a series of EntityForms I'd like to guide users through. After filling out the initial form, I want the submissions confirmation to recommend subsequent forms based on some of the values in the submission. I figure I can do this with a custom form submission handler, but I was wondering if it would also be possible to do this with Rules. I can make a Rule trigger on EntityForm values, but I don't know what kind of actions to include (I haven't done much with Rules yet).

Any thoughts on using Rules here, or any other approaches to this problem?


texts: Daily cron job to download and email Webform submissions file

texts:
On a Webform I can download a tsv (tab delimited) file and select the 'Only last submissions since download' option.

What I want to do is have a daily cronjob which does the same thing and emails this file automatically.

How would I do this? Is there any existing Module to do this in Drupal 7?


texts:
I want to create the following mapping for a product node: This is extracted and amended from an existing feed.

    'mappings' => array(
    0 => array(
      'source' => 'SKU',
      'target' => 'guid',
      'unique' => 1,
      'language' => 'und',
    ),
    1 => array(
      'source' => 'SKU',
      'target' => 'field_product:sku',
      'unique' => FALSE,
      'language' => 'und',
    ),
    2 => array(
      'source' => 'title',
      'target' => 'title',
      'unique' => FALSE,
      'language' => 'und',
    ),
    3 => array(
      'source' => 'body',
      'target' => 'body',
      'unique' => FALSE,
      'language' => 'und',
    ),
    4 => array(
      'source' => 'Group',
      'target' => 'field_product_category',
      'unique' => FALSE,
      'language' => 'und',
    ),
    5 => array(
      'source' => 'length',
      'target' => 'field_dimensions_length',
      'unique' => FALSE,
      'language' => 'und',
    ),
    6 => array(
      'source' => 'width',
      'target' => 'field_dimensions_width',
      'unique' => FALSE,
      'language' => 'und',
    ),
    7 => array(
      'source' => 'height',
      'target' => 'field_dimensions_height',
      'unique' => FALSE,
      'language' => 'und',
    ),
    8 => array(
      'source' => 'unit1',
      'target' => 'field_dimensions_unit',
      'unique' => FALSE,
      'language' => 'und',
    ),
    9 => array(
      'source' => 'weight',
      'target' => 'field_weight_weight',
      'unique' => FALSE,
      'language' => 'und',
    ),
    10 => array(
      'source' => 'unit2',
      'target' => 'field_weight_unit',
      'unique' => FALSE,
      'language' => 'und',
    ),

The first five items are OK and will map via nodes, the others, from 5 to 10 will not.
When I go to /Admin/Content/Settings/Content types/Product display/Manage Fields The field_weight element and field_dimensions elements are clearly shown.
How can I amend the node mapping to take these fields into consideration.?


texts: List all Ubercart product fields found in uc_product_field_extra_fields()

texts:
I am trying to use the Fields API to list all of the Ubercart product fields (cost, model, sell_price, weight, etc). I have tried

entity_get_info('node')
field_info_bundles()
field_info_instances('node', 'product')
field_info_extra_fields('node', 'product', 'form')

field_info_instances() gives me the image field and the catalog taxonomy, but none of them return the fields added by uc_product_field_extra_fields(). I thought for sure field_info_extra_fields() would return it, but all I get back is title and path. What is the correct API call to list these fields? I don't need them in display form or anything like that.

I'm using Drupal 7.12 and Ubercart 3.0.


texts:
I have added a menu item in main-menu using following code

$item = array(
    'menu_name' => 'main-menu',
    'link_path' => 'my-profile',
    'link_title' => 'Services',
    'module' => 'menu',
    'weight' => 0,
);
menu_link_save($item);
menu_cache_clear_all();

this code is placed in lcp_theme function, lcp is custom module and is working properly except this added menu item.
I cant see this menu at top of the site in main menu.

As per the documentation I can use this function anywhere in module.


texts:
I am using the Services module, through which I have created XML.

But i want to import this XML data into another drupal website. It contains images too.

I also installed feeds module but don't have idea how to use this.


texts: View with list of all taxonomy terms except active node's term

texts:
I have an request to create a view based on taxonomy terms. Basically it's opposite of standard Taxonomy Terms list.

I have an content type for videos. Each video has its category of course. On full node (and on taxonomy pages) first view lists all related nodes of that category (taxonomy term), format used is flexslider and contextual filters are the same as the generic taxonomy view has (taxonomy terms with depth). It works fine.

Now I need a list of all other nodes from other categories, grouped by taxonomy term. And it's not so hard until I want to EXCLUDE the category (term) of a current node. Logically because it is already there.

If there is no solution please advise me how to sort groups in that way the active category comes first on the list. i.e. NODE1 has TERM1, on its node first is a list of all nodes from TERM1 and then comes TERM2, below TERM3, etc.


texts: creating messages that appear after content is created

texts:
I am trying to create an a message to appear with a link to the content when the new content is created

Thanks for any help on this


texts: Setting menu weight for "Edit" and "View" items in a node

texts:
I am trying to rearrange the order of my menu items for my custom node. Most of the menu items are created programmatically in hook_menu() so I can simply set the weights for those which works great. But I would like to move the edit menu item down the list a bit but I can't find a way to change its weight from the default of zero.

Is this possible?


texts: Generate Rate widget for specific user based on UID

texts:
Basically, I'm going to be displaying a list of users who have voted on a node, but then show in a modal what their rating was. Now I can use the voting api to get what they voted, but I can't generate a display only widget for what they voted based on the user ID.

Any ideas? This is the function from the Rate module.

/**
 * Generate a widget.
 *
 * @param int $widget_id Widget id
 * @param string $content_type "node" or "comment"
 * @param int $content_id Node id (nid) or comment id (cid)
 * @param bool $teaser
 * @param bool $include_div
 * @return array
 */
function rate_generate_widget($widget_id, $content_type, $content_id, $mode = RATE_FULL, $include_div = TRUE, $just_voted = FALSE, $displayed = NULL) {}


texts:
I'd like to create a users page (author page) where Articles by that user will be displayed.
For example mysite/users/John needs to return teasers of articles that wrote the Author John.

I don't know how to make this when I have names in the URL. I can make the list of recent articles of a user only on paths like mysite/users/1.

This is how my configuration in Views looks like:

In Content: Author uid I have selected Provide default value --> User ID from URL. From that it only looks for ID and can't recognize a name in the URL (i'm using pathauto).


texts: What is the correct way to get the link url?

texts:
We have a Basic Page content type with a link field (field_link). When we call the mymodule_preprocess_node(&$variables) hook in a custom module we use ksm($node->get('field_link')->first()) and it returns a Drupal\link\Plugin\Field\FieldType\LinkItem. We need to extract the URL from this fields and have found two ways to do it (see below). What is the correct way to get the URL from the field?

The reason for extracting the URL is that we need to wrap a set of custom fields with the link so we can have a HTML structure similar to below.

HTML structure:

   Some title field

mymodule.module

...
function mymodule_preprocess_node(&$variables) {
  $node = $variables['node'];
  $node_field_link = $node->get('field_link')->first();

  // Do we use this?
  $node_field_link_url = $node_field_link->getUrl()->getUri();

  // Or do we use?
  $node_field_link_url = $node_field_link->get('uri')->getValue();
}
...


texts:
My site has different types of groups. Some allow registered users to join, others are by invite only and the existence of the group is not publicised.

I want to make a view (or block) of groups that a user is able to join, (i.e. group permissions for outsider: can "join group").

Groups that are secret, or groups that the user has already joined, should not appear in the view.

Is this possible through views contextual filters/relationships? If so, how?


texts:
After upgrades of most modules on my websites, including the media 7.x-2.0-unstable4 to 7.x-2.0-unstable6, i have a problem with the tabs on the overlay media browser.

It does not show the tabs, but instead render them as normal li links.
I have attached a screenshot. It's in Danish, but i suppose you can get the idea from it.

I am not sure if it's a media module issue or something else causing it.
I've tried to clear cache and also changed java script aggregration settings without any luck.

http://www.oldtrafford.dk/media.png


texts: Send email after 100 webform submissions

texts: I'd like to be able to send an email to the nth person (or every n people) that submit a specific webform. I've tried utilizing rules for this, but I can't seem to expose webform submission data to rules (using submission id). Any thoughts on how this could work through rules? Any suggestions for alternatives?


texts: Use custom marker when specific checkbox is checked

texts:
I am building an events page. The page is using Gmap, Locations and Views modules.

In the content type "Events", I have set a checkbox for "Featured Event", I want these events to stand out in the map, so I would like to use a different marker in the map if the event is a "Featured Event".

Please let me know how to do this. Thanks in advance


texts: Pull webform submissions in different webistes to one end-point

texts:
hypothetical example:

website1 has 2 webforms, I need to access the submissions of the 2 webforms in another website2

So if an user send the webform in website1 I need to log in as admin in website2 and see that submission. In few words, pull the webform submissions to one endpoint website (without the necessity of click a button or run a command), Master-Slave where the slave is the endpoint website that is only going to show results of webforms.

is this possible?

My use case: I have a lot of surveys in different websites hosted in different servers, I need an endpoint where to collect all the results and show it to my users, so I need have the submissions stored in my endpoint website for show results to my users.

Thanks


texts: Why are there so many different ways to translate menus?

texts:
I'm very confused about the way Drupal 7 translates menu items. I have many modules installed, so I'm not sure which would be relevant to state; in fact, I don't have my head fully wrapped around which modules do what and what they are dependent on.
I'm working on a bi-lingual website, in English and French. I noticed two different ways to create menues with translation. Let me outline the steps and results for both, and you can explain to me why these differences exist and how to effectively apply these differences.
Method 1

Go to Structure>Menu>(select the menu you want)
Click Add Link
Provide a "Menu link title" and "Path"
Under language, select English
Save
Translate this menu item into french

Result of Method 1

There are TWO menu items under Structure>Menu>(select the menu you want), one for each language item.  Additionally, I can no longer convert a menu's languge from English or French back to Language Neutral...what's up with that?

Method 2

Go to Structure>Menu>(select the menu you want)
Click Add Link
Provide a "Menu link title" and "Path"
Under language, select Language Neutral
Save
Go back to the edit form of the menu link you just saved, change language to English and save
Translate this menu item into french

Result of Method 2

There is ONE menu item for the link you added under Structure>Menu>(select the menu you want).  But when you edit that menu item, you will see the french translation under the translate tab.

Why is the Result of Method 1 different from the Result of Method 2?  Why is it that in Method 1, each translation is a new menu item, but in Method 2, translations are grouped together?
It is so easy for a user to forget to select a language when creating a menu item, which unintentionally creates a parallel track of information in the site (it's almost like a duplicate site where we lose the correlation between english and french pages ).  Fixing this after the fact would be so troublesome!


texts: How to sort terms in Views by their weight

texts:
I have Dictionary with several taxonomy terms. When I use Edit tab near each term in Structure/Taxonomy I see that I can give weight for any term.
Also I can drug and drop them in any order in list of terms for my vocabluary.
More than it, when I after this procedure go and look at weights - they are in new order.

So, problem is that then I use Views to make block with my taxonomy terms (I use unformated list) and use Taxonomy weight as sorting criteria - sorting always goes in alfabetic order.

And when I made additional field in View to show terms weight - I found out that all terms have weight -8.
How I can make term order in my Views display according to their weight?

Thank you.


texts: Views RSS channel properties added with hook_views_query_alter() disappear

texts:
I have applied this patch to the Views module so that it will add the channel properties of pubDate and lastBuildDate.

Then I ran Drupal "Clear all caches" within /admin/config/development/performance.

The added channel properties are only available for the first page requested each time after running another Drupal "Clear all caches".

For Drupal 7 how can I ensure that views RSS channel properties that are added with hook_views_query_alter() remain?

=================================================================================

I have already tried the “Views RSS” module and after downloading and enabling this module along with its associated “views_rss_core” the “RSS Feed – Fields” radio button does not display and only the “RSS Feed” option is present which comes from the “Views” module.


texts:
I'm using this in node add form alter to hide field 'field_obyavlenie_ploschad_uch':

$form['field_obyavlenie_ploschad_uch']['#states'] = [
  'invisible' => [
    'select[name="field_obyavlenie_rubrika"]' => ['value' => '4524'],
  ]
];

But if user enter any value in this field (before the field was hiding) I see this value in Node view.

I'm trying empty field value, but it not working:

$form['field_obyavlenie_ploschad_uch']['#states'] = [
  'empty' => [
    'select[name="field_obyavlenie_rubrika"]' => ['value' => '4524'],
  ]
];

How empting invisible field?


texts: Using Drupal 5 Gmap + location. What's the Drupal 7 equivalent?

texts:
I have an existing Drupal 5 site that I want to port over to Drupal 7.  In my existing site, I have custom CCK types for, for example, a business type such as restaurants.  I have the Location and GMap modules enabled.  When entering a new restaurant, I type in the address of the restaurant and it is geocoded and the node type displays a map.

Now in Drupal 7 I'm trying to figure out how to do the same thing.  I know CCK got partly rolled into Drupal 7.  Which modules should I use for entering in the address info?  I looked at the Location and GMap modules but they're both currently in dev only and I don't want to run development modules on my production site.  So what's the drupal 7 way to handle address info, geocode it, and display a google map?


texts:
I'm used to leverage Bundle Copy to import/export content types with Drupal 7. One of my expectations with Drupal 8 is that I could theoretically achieve this with CMI. On the Bundle Copy project page it's also mentioned that "Bundle Copy is in Drupal 8 Core CMI!" so it all looks promising.

However, due to UUIDs and CMI's focus being on supporting content staging across multiple instances of a same site, it doesn't seem that obvious to create a generic content type that you would export on N number of sites.

For instance, take a photo gallery content type. Once you've created it and that you're happy with everything, you probably don't want to go through the same hassle again and would likely prefer to simply import the YML files onto the active configuration dir via CMI's single import tab (by manually copying the content of your YML files) or via the Synchronize tab (by making YML files available under the staging dir).

I thus wonder if a) I've missed something and b) if yes, what's your recipe for portable content types, if any?


texts: Allow node author to assign edit rights for other users

texts:
Use case: user X creates a node and wants to give user Y the ability to edit the node as well. Think page administrators on Facebook. An Entity Reference field can be used to allow the node author to associate other users with the node, but how to provide edit rights for selected users?

A simple and common use case is a business directory website where Employee X creates a listing for Company Y and wants to allow Employee Z to edit the listing as well. There are several similar solutions out there but I've not been able to find a specific module or recipe for this common use case. Any ideas?


texts: Is it even possible to export webform form snippets?

texts: Say I've built a small contact-form with the famous module Webform and I want to paste it in node.tpl.php (or node.twig.yml in Drupal 8) and then customize it's code manually and more easily. Can I export a ready to work HTML-PHP code from the Drupal UI somehow?


texts: List of people with fields for demographic information

texts:
I have two D7 projects where I need to create lists of people. The people will not have control of their profile and their profiles are information based; titles, academic/sports teams they participate, experience, education etc. When articles are written and the article is about or includes their name, the article will link to their profile. For example, one is a list of high school staff and students the other a list of elected representatives. When the lists are created I plan on using views to view the list alphabetically, by title, education, grade level, activities etc.

sample fields:
first name
middle name
last name
maiden name
title
date of birth
URL with description that will link to news articles about them
College
College major

How do I create a content type that will allow me to do this? What modules should I use? The content profile I have created requires a Title and Body. The Body I could use for misc. info. but I cant seem to be able to create a list that will do the above without the Title. And I am hoping to learn how to do this properly.

Fairly new to Drupal. Thank you.


texts: Grouping multiple columns in a view result for a report

texts:
I have a requirement in which I need to display the stock report for an application as in the below image

I want to know how to group the Quantity, Batch no and Expiry date fields together in another column (Opening Stock) in Views. I am using Drupal 7 and Views 3.

Also I need a summary of the quantity in the footer of the view, for example sum of all quantity for a batch in the footer. Any help from the community is highly appreciated...


texts: Is it reasonable to run hundreds of sites by one Drupal core?

texts: There are more than 100 sites that are supported by our company and they can be presented as sub domain as well. from technical perspective is it reasonable to run all of these sites using only one Drupal core? is there any drawback in doing such thing? or we should have multiple cores?


texts: How to create custom date display format that displays event duration

texts:
I am new to Drupal. I want to display event date like,

"28/07/2016 | 02 PM to 04 PM"

Default date formats display date like,

"28/07/2016 - 02 PM to 28/07/2016 - 04 PM"

How can I create such custom display format?


texts: How do I restore the comment body field I deleted from a content type?

texts:
I deleted the comment body from the content type settings, and replaced it with  another field. When posting comments, I get this error:

  Notice: Undefined property: stdClass::$comment_body in function comment_submit() (line 2201 in file /modules/comment/comment.module).

Can this error be avoided?

It was needed to delete the field comment_body becase field permissions are inherited for all the content types and that is why another field was created and this one was deleted.


texts:
In my .tpl.php template files, I have several links and names of external websites. I would like to print these as variables, which are defined in template.php. That way, if I have to change a link, I can just change it in template.php and have them updated in all my tpl.php files.

How can I do this?

 Steps I have tried

In this tutorial, it says you can define your variables in themename_preprocess_page(&$variables). You can then call them with <?php print render($page['your_variable_name']); ?>

However, when I try this, I  just get a message stating Notice: Undefined variable: page in include(). The variable also doesn't print.

Also, if I use this method, can I use my variable in all tpl.php files or just the page.tpl.php file?


texts:
How do I create a view that will display all content of type 'Accountancy' and also all content with a taxonomy term 'Accountancy' (of any content type)?

I am trying this with a filter of Type: Accountancy OR Taxonomy: Accountancy but this is only showing the taxonomy nodes. The only filter that would work was the Delta.

Thanks Елин Й & morbiD - You both suggest the same answer, however, this does not work, please see screen shot below. (N.B. all this content is not published and only used these views)


texts:
TL;DR

In Report → Status, I’ve the following error:

Writable (public download method)
The directory /var/priv_fls does not exist. You may need to set the correct directory at the file system settings page or change the current directory's permissions so that it is writable.

How can I solve this error?

Full Story

In my webhosting at Forpsi, I’ve got FTP access to folder, in which there is www folder (let’s call this folder web_root). I’ve installed Drupal 8 in web_root/www. Then, I’ve added to web_root I’ve created a folder called priv_fls—for private files—and chmod’ed its permissions to 777 (I know it’s not secure). In web_root/www/sites/default/settings.php the following line: $settings['file_private_path'] = '/var/priv_fls'; and Cleared all caches (in Drupal). Then the error above appeared.

It might be that it is not /var/priv_fls from Drupal’s point of view, but even tried to change it /priv_fls in settings.php, but the error remained.

Update

I emphesise that web_root is only a substitution for the ‘root’ folder to which my webhosting provider (Forpsi) gives me access. If I login to the server using FTP, this web_root folder lists the following files:

/> ls
drwxr-xr-x    9 66573      users            4096 Sep  5 20:10 .
drwxr-xr-x    9 66573      users            4096 Sep  5 20:10 ..
-rw-rw----    1 66573      users               7 Sep  1 02:39 .ftpquota
dr-xr-xr-x    2 0          0                4096 Jul 15 22:01 backups-forpsi
drwxr-xr-x    2 66573      users            4096 Sep 23  2010 data
drwxrwxrwx    2 66573      users            4096 Sep  5 20:10 priv_fls
drwxr-xr-x    3 66573      users            4096 Sep  1 12:54 softaculous
drwxr-xr-x    2 66573      users            4096 Sep 23  2010 stat
drwxr-xr-x    2 66573      users            4096 Sep 23  2010 tmp
drwxr-xr-x   10 66573      users            4096 Sep  4 19:40 www

But I can’t get the absolute path (pwd gives me ftp://user@server.com:/>; ls .. gives me same output as ls; both of which are useless from the point of getting the absolute path).

Anyways, Drupal is installed on shared webserver.


texts:
I'm trying to build a multi-step form with Ctools that will submit to another website upon completion (a hosted payment page). On the last form page, I have set the #action property in the form array to allow it to submit to this other website. My issue however is that this seems to affect the Back button behavior on this form page and directs me to the website I specified in #action when clicked, which is obviously not desired.

Are there additional settings I can tweak to make the Back button behave correctly with the #action property set?


texts: Is there a jQuery container selector for CCK fields?

texts: I'm using a Drupal module called FitVids, which makes iframe videos and images responsive. But i'm also using the YouTube Field module and the fitvids module is distorting the YouTube Field module's video player. So I need to add the CCK field to the exclude list for the video container using the jquery :not() selector.


texts:
I'm working on an upgrade process, and I've noticed something strange when I upgrade my D6 site to 7. I've noticed some behavior that's kinda odd, and was wondering if anyone one else had experienced something similar in their upgrades.

1: Some users have the their avatars in the "file_managed" table, uri field set to:
sites/default/files/user-pictures/...

These are the correct pictures, but they won't work with image styles unless I switch the value of uri to be the correct uri format. Any ideas why some of the images wouldn't get switched to the proper uri formate durring a 6-7 upgrade?

2: Some users have the completely wrong avatar. The avatars aren't even necessarily other user's avatars, though some of them are, but some are just images from site pages. For example, user 55 in D6 had an avatar at picture-55. After upgrading, I find no record of an image with the file name of picture-55 in file_managed, the user table says his user image is set to a file with an fid of 20, which is in attached images.

I've got a lot of users, so making sure the avatars mach up correctly is important. I would appreciate any help in figuring what's causing this/how to fix it.


texts: Help with wrapping character with CSS span using Jquery

texts:
I have this jfiddle working (http://jsfiddle.net/FJxcG/), but the same code does not work on my Drupal 7 website. I added the JS file to my theme .info file, and the JS is showing up in the source; it's just not displaying the end result on-screen.

The reason I need this is so that I can wrap a span class around all instances of the Trademark special character (™). That character is too large in the font I am using, and I'd like to use that css/jquery function to apply the span so I can give the TM a smaller font size without affecting the rest of the text around it. Some of the TM's are within menu links, so I can't simply hard-code the new span class.

Thanks!


texts: Difference between bootstrap carousels and how to set up?

texts:
I have tried to add the bootstrap_carousel to the Bootstrap Business template. I have researched every possible forumpost about this slider, but can't get it to work.
Now, the slider works perfectly just as content, but I want to create a view in order to implement it on every page as a banner. Therefore, I followed this guide.
My view does not work. I get to see this:

My settings for that view are:

Anyone with an idea about what's going wrong? Again, my content type itself is displaying fine, as you can see in the following screenshot. It is the view that is not working.

UPDATE
I inserted a custom block with PHP code, but now I have a new problem. Sometimes, two images become active:


texts: Drupal 7 use custom layouts created by Panels module

texts:
I have recently installed the Panels module. It allows me to create custom layouts for my contents. I now want to choose these template layouts while creating/editing a certain type of component so that when viewed that content appears in the selected layout.

I am a newbie in Drupal and more so in the Panels module. So not really sure if my requirement is feasible in the first place.