texts:
I am trying to use the Feeds module to automatically process CSV files in a directory to create nodes.

To help I installed this module "Feeds Fetcher Directory".

I already have the content type built and run into an issue when trying to setup the "Feeds Fetcher Directory".  On the settings page I only have an input for "File mask"

What is not clear is where I define the directory and what global feeds settings I should use to have it use cron.

When on the "Feeds Fetcher Directory" settings page I get the following error when just trying to click save for the default mask:

  Notice: Undefined index: directory in
  FeedsFileFetcher->configFormValidate() (line 274 of
  /home1/theches8/public_html/sites/all/modules/feeds/plugins/FeedsFileFetcher.inc).
  Notice: Undefined index: allowed_schemes in
  FeedsFileFetcher->configFormValidate() (line 275 of
  /xxx/public_html/sites/all/modules/feeds/plugins/FeedsFileFetcher.inc).
  Warning: array_filter() expects parameter 1 to be array, null given in
  FeedsFileFetcher->configFormValidate() (line 275 of
  /xxx/public_html/sites/all/modules/feeds/plugins/FeedsFileFetcher.inc).
  Notice: Undefined index: direct in
  FeedsFileFetcher->configFormValidate() (line 277 of
  /xxx/public_html/sites/all/modules/feeds/plugins/FeedsFileFetcher.inc).

Please specify an upload directory.

UPDATE:

Based on the feedback from the folks in this forum I tried to install the newest development version of the feeds directory fetcher without success.   I was still unable to determine how to give it a directory that could be space scanned via cron for CSV files import. I did however successfully get my needs met using the core feeds module I was able to just have my back and point to a single CSV file that would be appended to as needed and was consumed the cron.    thanks to everybody on the forum for their help


texts: how to create single flag for choosing multiple bookmarks?

texts: I want to create a flag which can be used to bookmark multiple content. In my site i am allowing user to publish their own articles. Each article has a genre type taxonomy. I want to make a flag which will be displayed below the article content page, and on clicking on the flag the user will be able to subscribe to both the article and its genre (taxonomy). I tried using flags for taxonomy but that flag does not appear on the bottom of every content page. Instead it appears on the view when we seea ll the content related to a genre. I am using drupal 7. Thanks for your help.


texts: How could I allow content editors to send email to a selected bunch of users?

texts: I have a content editor that wants to be able to send emails on a regular basis to a selected bunch of users. Could I create a view of all site users and use Views Bulk Operations for this?


texts: Quick tabs module change title to bottom

texts:
I am facing a problem. I have a module called QuickTabs, new to Drupal and confused.

I like to change the position of the title of the quicktabs, instead of top and I would like my buttons or links to be on the bottom. I worked the css but it seems that the render is on the inc.

    tile1 title2
---------------------------
    content content

Change to:

     content content
---------------------------
     title1  title2

Any hints of how I can do this? I am using Drupal 7


texts: Using drush config import and update db in a rolling deployment (k8s) environment

texts:
Disclaimer: complete Drupal newbie here. I'm the infrastructure guy in the team.
We are running various Drupal 8.9 instances on Kubernetes using a managed MariaDB outside k8s.
We build Docker containers for each instance on a build server using composer. Then, once deployed, a script initializes Drupal using a combination of drush cim, drush cr, drush updb and a few conditionals.
Kubernetes provides a rolling deployment so the current instance keeps running until the new container is up.
Now here's the issue I can't wrap my head around: the new and old instance both write to the same database. So drush cim from the new instance runs against the same DB as the live environment, possibly breaking the live instance.
I'm currently trying to catch this in my init script, but it proves to be non trivial. Ideas I came up with like cloning the db, doing the import there, testing if it works and then reimporting on the live instance appear overly complicated, Right now I do a dump before the drush cim so I can at least restore the instance if it fails but the site might still go down for a few minutes ... is there a Drupal way of doing this properly? Maybe a config import dry run or forcing drush cim to use a SQL transaction? Do you guys have any idas or input? Anything helps. Thank you!


texts: Should I replace Magento with Drupal for my e-commerce solution?

texts:
I am working on an e-commerce project. Essentially, it's a 'expansive product catalog -> shop cart; users database' type of thing. Everything is still in development environment. I am trying out Magento, I have mixed feelings about it. It is plug-n-play powerful, it seems to suit a lot of situations out of the box. However, now that I am getting to know it better, I see that I will have to get my hands dirty and code, customize, add features of my own, concerning website visual and non-visual design.

Is Drupal easier to work with for a developer/designer? How can product catalog importing/exporting be handled in Drupal? With Magento, I use Magmi and csv, which I love. I will definitely be implementing some kind of automated catalog updating, which I was planning to do with Magmi; that is very important to me.

In general, could you advise on your experiences on Drupal v. Magento for e-commerce?

Edit:

Conclusion:

I will be switching to Drupal, because I have found that even though Magento has many mature built in features, I only need a select few of them, and I have too little control over them, it feels like it is cluttered and rigid in my situation. I need something that is more friendly to 'going under the hood', and I think Drupal is it. I think if I was a better programmer, I could get Magento to suit my needs, but I'm afraid I'm not. Goodbye, Magento.


texts: User Login Destination | to his first submission | Webforms

texts:
i have a career form built with webforms ; I need the users to go back to their first submission when they come back to the site again .

Login Destinations | can help me with that . but it will send only to a specific URL . where in my case every user have its own submission and i want him to return back to it in Edit mode when he/she logins again .

any clues /
thanks


texts: Why is hook_form_alter() not setting default values in _after_build function on /node/add/myct?

texts:
I've got a validation form (id="mymodule-myct-verify-form") that retrieves data from temp_node to populate it's hidden fields. On submit, the form sends its data to /node/add/myct. (currently via $form['#method' = 'get';, which I'm planning on changing to 'post') What I want to do is this: in mymodule_hook_form_alter, get the data from $_REQUEST (later $_POST) and use that to set the default values of my CCK fields. Currently, jQuery is the approach I'm going for, being unable to get mymodule_form_alter() and mymodule_after_build_convert() to work. Here's what I've got:

 function mymodule_form_alter(&$form, &$form_state, $form_id) {
     if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'].'' == "myct") {
        // if converting, set default values through an after_build function
        if (isset($_REQUEST['conv']) && (strip_tags($_REQUEST['conv']) == 'app') &&
            isset($_REQUEST['taid']) && (intval($_REQUEST['taid']) > 0)
            && ($form['type']['#value'] . '_node_form' == $form_id &&
            (strpos($form['#action'], '/node/add/myct') !== FALSE))
        ) { // on the /node/add/myct/?conv=app&taid=1 page, this is true
            $form['#after_build'][] = 'mymodule_after_build_convert';
        }
  }
}

function mymodule_after_build_convert ($form, &$form_state) {
    //TODO: Set default values for CCK fields
    /*dsm($form);
    dsm($form_state);
    dsm($_REQUEST);*/
    // set receiving date and time
    dsm($form['#field_info']['field_status_10']); // date popup
    $form['#field_info']['field_status_10']['widget']['default_value'] = time();     //date("j F, Y - H:i");
    dsm($form['#field_info']['field_status_10']);
    // set deal type (select list)
    $form['#field_info']['field_deal_type']['widget']['default_value'][0]['value'] = intval($_REQUEST['ta_type']);

    return $form;
}

Why is my date_popup field empty instead of containing today's date? Why does the select list not change?


texts: How to send password recovery in user's saved language?

texts:
I have set everything accordingly as described in different answers of all this kind of questions, But could not solve problem.

I want to sent password recovery email either in English or in German language depending on the user's saved language. I have added translation by enabling variable_translation sub module of internationalization module.

And email is being sending in English and German but Drupal choosing language that is current language of site instead of choosing user's saved language. I have also enabled the option "Follow the user's language preference." on this page /admin/config/regional/language/configure.

Can anybody help me what could be the problem?


texts: Able to use custom variables in page.html.twig but not in menu.html.twig

texts:
I have a module setting config variables which I'm trying to display in a twig template. When I use

function mytheme_preprocess_page(&$variables){
    $variables['facebook'] = \Drupal::config('social.settings')->get('facebook', 'No username');
    $variables['twitter'] = \Drupal::config('social.settings')->get('twitter', 'No username');
    $variables['instagram'] = \Drupal::config('social.settings')->get('instagram', 'No username');
    $variables['youtube'] = \Drupal::config('social.settings')->get('youtube', 'No username');
}

I'm able to display the variables in my page.html.twig template by invoking

{{ facebook }}{{ twitter }}{{ instagram }}{{ youtube }}

However I'd like menu.html.twig to invoke it. Even when adding a preprocess hook for menu like so

function mytheme_preprocess_menu(&$variables){
    $variables['facebook'] = \Drupal::config('social.settings')->get('facebook', 'No username');
    $variables['twitter'] = \Drupal::config('social.settings')->get('twitter', 'No username');
    $variables['instagram'] = \Drupal::config('social.settings')->get('instagram', 'No username');
    $variables['youtube'] = \Drupal::config('social.settings')->get('youtube', 'No username');
}

menu.html.twig produces nothing when invoking

{{ facebook }}{{ twitter }}{{ instagram }}{{ youtube }}

I know menu.html.twig is being used because I can make changes to it and the changes will appear. I also know that mytheme_preprocess_menu is being called because drupal_set_message works from it.
However {{ dump() }} from menu.html.twig is not displaying anything on the page.


texts: How to create a View showing subscribed content?

texts:
I want to create a view which will display all the posts user has subscribed to (very much like the Facebook homepage).

I have used the Subscriptions module for allowing the user to subscribe to posts, but I am unable to configure the Views.

Any help will be appreciated.


texts: Migrate Module: How to construct a map on a UNION query

texts:
I am trying to create a hierarchical taxonomy from two different tables in the source database, one containing the parent entries, and the other containing the children.  Here is my query:

    $query1 = $this->getConnection()
      ->select('envirolib_area', 'a')
      ->fields('a', array('areaname', 'areaname_japanese', 'sort_order', 'acronym', 'areaid'));
    $query1->addExpression(':empty','parentid',array(':empty'=>0));
    $query2 = $this->getConnection()
      ->select('envirolib_task', 't')
      ->fields('t', array('taskname','taskname_japanese','sort_order','acronym','taskid'));
      $query2->addField('t','areaid');
    $query1->union($query2, 'UNION ALL');

    $queryx = $this->getConnection()
      ->select($query1,'x')->fields('x', array('areaname','areaname_japanese', 'sort_order', 'acronym', 'areaid', 'parentid'));

The envirolib_area table has a primary key of areaid, and the envirolib_task table has a primary key of taskid.  The envirolib_area table doesn't have a taskid column, and in my union I am actually calling a.areaid and t.taskid areaid, with t.areaid called parentid and 0 inserted in that column for rows from the envirolib_area table.

the addition of $queryx was necessary to stave of errors about unven numbers of queries in a union, which seems to be caused by the mapping method joining onto the query (thought the explanation I read, claimed that shouldn't happen if 'map_joinable' => FALSE as it is in my case.

So here is my attempt at MigrateSQLMap:

$this->map = new MigrateSQLMap($this->machineName,
  array(
    'areaid' => array('type' => 'int',
                       'length' => 3,
                       'not null' => TRUE,
                       'description' => 'Area ID',
                       'alias' => 'a'
                      ),
    'taskid' => array('type' => 'int',
                        'length' => 3,
                        'not null' => TRUE,
                        'description' => 'Parent ID',
                        'alias' => 't')
    ),
  MigrateDestinationNode::getKeySchema()
);

When I try to run the migration I get a wall of errors like this:

Undefined property: stdClass::$taskid File /Users/bob/ultrabob.prv/www/sites/all/modules/migrate/includes/migration.inc, line 943(file: /Users/bob/ultrabob.prv/www/sites/all/modules/migrate/includes/migration.inc, line 943)
Could not save to map table due to NULL value for key field taskid

How should I set up the MigrateSQLMap in a case like this?  Would it make more sense to migrate this taxonomy in two migrations, one for each table?


texts: Why would I get a 404 on "Authoring Information" autocomplete?

texts: Below is a screenshot of a 404 I'm receiving on the standard author autocomplete, and I can't figure out, for the life of me, why this would be happening.


texts: How to manage a views term filter at run-time?

texts:
I have a D7 View for which i need to pass filters at runtime and cannot use exposed filters.
I use

$filter = $view_search_works->get_item($display_id, 'filter', 'filter_name_tid');
$filter['value'] = VALUE;
$view_search_works->set_item($display_id, 'filter', 'filter_name_tid', $filter);

for the filter i have defined for a taxonomy term.

If i define the filter with the "Is one of" and select all the taxonomy listed terms,when i pass one of the listed value, it runs fine.

The (big) problem is that if i define a new term (and it can happen) and pass it to the view, the term is not recognized and the view does not work.

Is there a way to say "all the taxonomy terms" for the filter? If i don't select a term when i define the filter, i get "No valid values found on filter:name".


texts: I have installed event calendar module and using Zen sub-theme.As event calendar module gives its own content type and view.I can see the content type however I am not able to find the default view Event Calendar in view list.Anybody know the reason please revert.


texts:
Is it possible to get BeautyTips working with a new version of jquery 1.7 or 1.8.

Firebug returns the error.

`Uncaught TypeError: Object function (a,b){return new p.fn.init(a,b,c)} has no method 'curCSS'` - jquery.bt.min.js?v=0.9.5-rc1:97

Is there a new version of jquery.bt.min.js that will work?


texts:
I am running drupal 6 and I get this warning on every page.

warning: Illegal offset type in isset or empty in /var/www/my-website/includes/common.inc on line 915.

And this is what I have from lines 914 to 917 in common.inc file

// Custom strings work for English too, even if locale module is disabled.
if (isset($custom_strings[$langcode][$string])) {    /* Line: 915 */
  $string = $custom_strings[$langcode][$string];
}

What could be the possible reasons for the warning and how to get rid of it? Any help is appreciated. Thanks.

Edit:
   This warning appears only for anonymous users and it is not visible for authenticated users.


texts: How to display common taxonomy terms from 2 diffrent vacabulary in views

texts:
I have 2 vocabulary and this vocabulary used in content type. I want to display common terms from different vocabulary.

1) Basechart taxonomy:
   - Alphabets
   - ASER
   - Story
   - ASER(D)

2) Endchart taxonomy:
   - Alphabets
   - ASER
   - Story
   - ASER(D)

Now my result displaying this:
Name       Mark1       Mark2
Alphabets      1             0

Alphabets      0             1

Story             2             2

ASER            0             1

ASER            1             0

ASER(D)       0             1

ASER(D)       1             0

I want to display below result:
Name       Mark1       Mark2
Alphabets      1             1

Story             2             2

ASER            1             1

ASER(D)       1             1


texts:
I have a webform that sends an email. The webform has a date field and I need to format that date field.

I have tried:

[submission:values:date_field:CUSTOM_FORMAT]
[submission:values:date_field:long]
[submission:values:date_field:value:custom:d-M-y]

Both result in a blank date.

How can I format the date in a webform email using a non-default (which appears to be short) date format?


texts:
Am I able to add the following field to a content type, so that each piece of content I create can be conditioned to a page?

Or is there a module to extend Publishing Options, where by it adds all the pages I have created (just like 'Promote to Front Page')?
If not, why is no one doing this? As a new user to Drupal this seems like it would be a handy operation. (I have already tried this module but it doesn't achieve the results I'm after).

If none of these solutions are available, what would be the best alternative way of doing this?


texts: Organic Groups - how to display a summary view of members of the group based on a "company" field added to the user profile

texts:
I want to create a block to display on my organic group nodes that shows the number of members of the group summarized by a field in the user profile (company)  for instance:

Company 1 (4)
Company 2 (1)
Company 6 (3)

I have played around with relationships adding a few trying to get the field I need and using the "(OG group) OG group: Og group ID" as a contextual filter--  I can get the field label (Company) to show up in the block view but the values don't show up


texts: In drupal website how to create multiple sitemap for each content types?

texts:
In Drupal how can I create multiple sitemaps for each content type?
Suppose I have a content type basic page. I want an sitemap.xml only for this content type. Is it possible?


texts: How to change the page path being reported to Google Analytics as a pageview

texts:
I would like a certain page path to be reported as a different page path, IF it has a hash on it.

/page-name#hash-name

should be reported as

/page-name/hash-name

Thing is that with the Google Analytics module I end up reporting two pageviews if I add this to custom js:

ga('send', 'pageview', '/pagename/' + window.location.hash.substr(1));


texts:
I have a link field in a content type, field_source. I created a computed field (field_source_domain) in the same content type, which should contain the domain for the link in field_source.

I tried with $value = parse_url('https://subdomain.example.com/foo/bar', PHP_URL_HOST); and it works, but when I tried $value = parse_url('$entity->field_source->value', PHP_URL_HOST); or $value = parse_url('$fields['field_source']', PHP_URL_HOST);, I didn't get anything.

How do I get the domain name using a computed field?


texts: How to change the field label in an API response

texts:
How to change field_canonicalurl to canonicalUrl and field_teaser to Teaser?

Below is my API output from my View:

[{"field_canonicalurl":"","title":"This is the title ","field_teaser":"\u003Cp\u003EIn this is the teaser \n" }]


texts: Adding Comments to Custom Node Template File

texts:
Is there a way to add comments/comment form to a custom template file without having to install the Panels module? I had initially thought I could do it through a php script on the page, but have yet to find an answer.

I'm stuck, but all I need is for it to be at the bottom of my custom template file, which is for a custom content type. Thanks!


texts: How can I check the value of an aggregated field without direct access to Solr?

texts:
I'm using Search API Solr on Pantheon (which means I don't have direct access to the Solr backend), and I've set up an aggregated field in the UI.  This aggregated field is a Fulltext aggregation of a boolean field and a Countries module field, but it isn't working as I am expecting.

Search API Views allows the indexed fields to be displayed, but it does not display the values of aggregated fields.  I can filter by the value of the aggregated field, but since I don't know what the values look like in the aggregated field, I'm at a loss about what to input. So I need to check the value of the aggregated field somehow, but there appears to be no way to do this through any of the module UIs.

What I tried

I have tried running dpm() on the $view object through a views template, but as far as I can tell the aggregated fields are not stored there; they are queried on the Solr server, so Views doesn't touch them directly.

As an alternate approach, I went to the search index config page (/admin/config/search/search_api/server/MYINDEX/edit) and selected Retrieve result data from Solr, but that didn't give me the values of the fields, either.


texts: How to get search to display an error when no search terms are entered

texts: Right now if I don't enter a search query in the drupal search module, it returns results for 'search'. I would like it to display an error prompting the user to enter a search query instead. Is there some sort of setting?


texts: Add "Post as anonymous" checkbox to forum topic creation

texts:
is it possible to add a post as anonymous checkbox to the topic creation in drupal forum?

I can also provide a user if not a string via which the content should be submitted. Basically I don't want users to need to logout but directly from their account create a disguise username or anything that would resemble this functionality.

Thanks! Jan


texts: How can I see full server request to track suspicious requests?

texts:
I have very bad luck with spammers. Even though I employ both reCAPTCHA, Spamicide and BOTCHA, I get about one spammer per day, though 300 are blocked. I guess that's a pretty good ratio, but it still justifies me having to manually authorize new user accounts.

My website gets about 30K requests per day (as per access logs) of which 500 are POST requests. It runs on Drupal 6, though we are soon moving to 7.

I want to be able to see what the spammer sends when they make the request. Ideally, I would like to see the reCAPTCHA challenge they saw and what they wrote down. I'll be good with only the postdata, though.

Is there a way to achieve this using triggered rules? Is there a module which will allow me to do so (i.e. send the full request to log/email?)


texts: How can I get the responsive image style id from a FileFieldItemList

texts:
I am trying to get the machine name of the responsive image style attached to a field. I am not able to get this from the settings attached; it seems it is not accessible from the object in any way.

How can I get the responsive image style ID from a FileFieldItemList?


texts: Create view to display a Gmap for locations on node you are currently viewing

texts:
I am using Gmap 7.x-2.9 and Location 7.x-3.6 on my Drupal 7.34 site. I have setup a custom content type for "Locations". So if I, for example, added a new Location called "California" I could add in all of our California locations so when I go to the California page, I will get a Gmap displaying all of our CA locations. I am currently using the default block that comes with the Location module and set it up to display in the content area for my "Locations" custom content type nodes. This works and it indeed displays markers for all of the CA locations. The problem is nothing happens when I click a marker. I would expect to get a popup bubble with the address information for the clicked location. I see nowhere in any of the configuration for that block to change this behavior. You just don't get a popup. SO I figured what I could do is make my OWN view block and set it up where the content type is Location and only display it on the Location content type nodes. This also works, but when I go to any Location node, like California for example, it displays ALL of my locations in the entire system (other states). I want it to only display the locations for the location node I am currently viewing. I am thinking contextual filters? I just can't seem to figure out the right combination of settings in the view to display locations for the location node I am currently viewing. If I could figure this out, I can use the settings in the view to add the popup and decide what goes in the popup when you click a marker.

Thanks in advance for any help on this one.


texts: How to test Mollom - want to test mollom_form_moderation?

texts:
I have a custom form that I'm protecting with Mollom. Once validated, the form results in an entity being created and some emails being sent.

If the form is valid, but Mollom says it should be moderated, I need the entity to be created with its "Held in moderation" field set, but no emails to be sent (I'll do this once an admin has said it's OK).

I have Mollom working and testing mode enabled. Putting "ham" in works. Putting "spam" in stops it dead. Putting "unsure" with an incorrect captcha stops it dead and putting "unsure" with a correct captcha allows it through.

I'm trying to find a test to make Mollom say "hold this in moderation" and call the moderation callback that I have set in hook_mollom_form_info(). None of the test cases above result in this callback being called.


texts: Can't use Google Analytics Statistics Module - Impossible to login

texts:
I'm trying to use Google Analytics Statistics module but it won't accept my login credentials. I know they're correct because I tried them independently multiple times on the same browser to login to Google directly. I've also now try entering them 10's of times in the module and it never takes them. It takes my username but then rejects my password and gives the error 'Invalid Google Analytics login.'

I thought I found the solution, here, and it seemed to work for everyone else, but not for me. https://www.drupal.org/node/1370742

I did the patch - didn't help. I ran cron and clear caches a million times. I re-installed the module. I made sure I was logging in from the same browser where I was already logged into Google.

Note: Google never sent me an email, not once, asking me to confirm my login as the referenced article above suggests it would do.


texts: Drupal Views Exposed Filter ( Creating seperate filters for parent , child & grandchild )

texts:
How can one achieve following in exposed fliters

FILTER ONE (PARENT) FILTER TWO ( CHILD ) FILTER THREE ( GRAND CHILD )..

I dont want SHS or HS,

Please guide.


texts: Block classes are missing from markup. How do I use a block class using the Context module?

texts:
I am trying to place blocks using context in Drupal 8 and using The Block class module to give classes to blocks. The Placement/position of blocks is working fine, but block classes are not appearing in the markup. If I don't use context module then block classes are appearing in markup and working fine.

I am using following:

Drupal 8.2.2
Block Class 8.x-1.x-dev
Context 8.x-1.0-alpha1+2-dev


texts: Drupal Commerce: Price based on width / height calculation

texts:
I think has been discussed somewhere but i cant find it again...
i know complicated attribute pricing is possible with Rules, and something about custom line items, but i wonder how to accomplish a price in the case where

something has a size - width, height, etc. Price per inch.
There are different materials at different prices per inch.
the same product can add multiple items (First is 23"x34"x6" and the second 23"x34"x10")
A fixed price is set when a second level is added. (combination fee)

Is there anyway to do this with commerce? The only other idea I had was a custom javascript calculator that passes the price into the price field, but that seems to hacky.


texts: Odd behaviour on form validation when in block mode

texts:
Hi gurus and fellows,

I have to generate an application form, that needs to be displayed both a as "page" (hook_menu) and as "block".

I factorized the form generation within the same function (generate_form). It works fine, except for the validation process. Clearly the validation happens (form is not submitted when it fails), but the form_set_error() is never displayed  in block mode (in page mode, it works fine).

This "lack of display" also happens for regular validation ('#required'=>'true'), so I don't think my custom validation code is at stake :

When in page mode, the required fields get highlighted, the error
message is displayed.
When in block mode, the required fields get highlighted (red-bordered), BUT the error message is NOT displayed.

Of course, I checked that the page.tpl.php, used to display the block, has a 'message' section, within it. Proof is my drupal_set_message() gets displayed on submit.

Oddly enough, when I put a drupal_set_message() within my custom validation function, it gets displayed, as long as (and only when) the validation passes ! Wierd...

I pasted the *.module code here :  http://pastebin.com/cnwzp3UU

Any idea ?


texts: Drupal 8.3.1 CSS and JS aggregated by default

texts:
I just installed Drupal 8.3.1 and created my own theme. I have both 'Aggregate CSS files' and 'Aggregate JavaScript files' unchecked. Also, in my settings.local.php I have:

/**
* Disable CSS and JS aggregation.
*/
$config['system.performance']['css']['preprocess'] = TRUE;
$config['system.performance']['js']['preprocess'] = TRUE;

Yet, Instead of having all the css style sheets in head and all the JS files at the bottom of the page, I have 4 aggregated style sheets in head and one aggregated js file at the bottom of the page.

Any idea what is causing that?


texts: Drush or Drupal console command to list modules with security updates?

texts:
Is there a command for Drupal 8.x that shows available updates?

I added forms_steps 1.1 that has an SA and a security update required in the Web UI, which is saying to update to 1.2

I tried drush pm:security but it reports that there is no outstanding security.

root@d568732a8640:/app# drush pm:security
 [success] There are no outstanding security updates for Drupal projects.

I might have overestimated the capability of this command so I'm looking for alternatives to get both update and security update in the console. My goal with this is to add a schedule job in our CI that will report on those.


texts:
I want to handle the page content via a drupal module.

If the called URL is abc/[x] (for example abc/123, abc/456), then I want to render [x] on the page.

which is the best way in drupal to do this without views?

Thanks for your answer.


texts: How to view PDF files in a modal/overlay

texts:
I have pdf (managed) files on the server that I want users to view in a modal. This will be part of a module I'm creating. There are a couple of modules that help with this, but I haven't found a good way to incorporate those yet.

One of the most promising seems PDF Reader, but it requires you to create a node before it will do its magic. I would like to just use the file (managed file, stored using Drupal) and not create a separate node for each file.

I'm open for any suggestion. I have already implemented some CTools modals and Modal Forms (for easy display of Webform content) so I can work with that. But maybe it would be easier to create a node on the fly of the content type created for PDF Reader (say pdf file) and show that with a custom node--pdf-file.tpl.php. But how to create such a node then and how to get it in a modal?

Or maybe there is a more simple solution altogether. I'm using Drupal 7.


texts:
I'm first time seeing a link indexed by Google : taxonomy/term/10007/*  as in here.

What could be causing it?

I've already GlobalRedirect enabled, also not using the View "Taxonomy term" which emulates Drupal core's handling of taxonomy/term.


texts: Multilingual Taxonomy Views - Entity Translation

texts:
I am trying to create a multilingual taxonomy view using Entity translation.  So far, I am stuck displaying an English view even when using a language code.

I'm looking for the steps needed for this. At the simplest, I am trying to create blocks or pages of taxonomy terms based on language.

Any suggestions?


texts: How to email all group members after a new node is added when using the Group module?

texts:
I have created one group using the Group module. In that group I have 1 node type and 3 members.

I want to send a confirmation email to group members whenever I add new nodes of that node type. How can I do that?

Notes:

My question here is different from the question about "Mailing content to a list/group of email addresses" (mine is specific to the Group module).
I have not (yet) tried using the Rules module for this, since I don't know how to integrate the Group module with the Rules module.


texts: How to hide a Fivestar field in a comment when the user didn't vote?

texts:
The comments on my articles have a Fivestar field called 'Stars', but rating nodes isn't always required (see: How to hide rating field when adding comment to own node?). When the user didn't rate the node on which he/she is reacting, 0 stars (not saved in the database) are now being displayed in his/her comment, but I don't really like that.

How can I hide the stars when the user didn't vote?

Edit: I'm trying to find a workaround with flags. I've created a flag called 'Reaction on own' and a rule that flags a comment when the comment's author equals the author of the commented node. In my case, it's sufficient that the 'Stars' field isn't displayed when a comment is flagged with 'Reaction on own'. This is the code of my custom module:

function hiderating_comment_view($comment) {
  $flag = flag_get_flag('reaction_on_own');
  if ($flag->is_flagged($comment->cid)){
    unset($comment->field_stars);
  }
}

Unfortunately, this isn't working. What's going wrong?

Note: In fact, the edit above isn't entirely true in my case, because 'zero' stars appear when a user reacts on his/her article or when the user has commented before. I've provided an answer for both cases.


texts: How to add a field to webform entry form

texts:
I am using webform to build a quiz site. Every quiz will be an "option" type where users will choose a, b or c.

I need to add to each page, an extra field to indicate which is the correct answer. I would like to have for each question entry form, a field where I can indicate which is the correct answer.

I can figure out the rest if I can have a way to have a text box appear for every question into which I can paste the correct answer.

Thanks for your help.


texts: How to edit markup on existing pages using version 4 of the CKeditor library in Drupal 6?

texts:
I installed/enabled CKeditor version 4 (from its download page) to use it in a Drupal 6 site. It's working fairly well with one exception: editing markup on existing pages doesn't work.

What happens is, that old pages won't accept the changes. It's baffling: the code is correct and it shows up in the source, but it's not rendering on the page for nodes that were created before I installed CKeditor 4. For example, I have a line with a line break at the end of it, but the line breaks aren't showing up.

But for new pages, the line break works just fine. It's only the old nodes where it's not showing up.

And if I uninstalled CKeditor version 4 and go back to CKeditor version 3, the issue disappears.

Any ideas or recommendations?


texts: How to expose Profile2 fields in Services?

texts:
Is there a good solution to CRUD a user's Profile2 fields via Services? I assume this can be done with Services Entity API, but I wonder if there is a more direct integration?

With Services Entity API, I enabled the entity_profile2 resource and can load an index of profiles. I need to disable the ability to index the profiles but allow a user to retrieve their own profile.

From the docs, this URL should be able to find user with uid=296's profile:

api/entity_profile2.json?parameters[uid]=296

But the result is an empty page.


texts:
Is there any way include pdf files in common drupal search. I tried http://drupal.org/project/search_files module. But it gives the results under a separate tab. Is there any to include them in common drupal search.
I  merger the result using hook_preprocess_search_results.

   $file_results = module_invoke('search_files', 'search', 'search', arg(2));
   $count = count($variables['search_results']);
   $variables['search_results'] = '';
   $f = null;
   $filecount = $count + 1;
   foreach ($file_results as $result) {
      $f[$filecount] = $result;
      $filecount++;
   }
   $variables['results'] = array_merge($variables['results'], $f);

But this also is not working. Anybody can suggest a solution? And one more doubt. Is there any way to change search result count.


texts: Drupal javascript file loading and jQuery

texts:
I have several javascript files in custom modules containing many functions which are used across the code.  In D6 I simply added them during hook_init() and it was fine.

drupal_add_js("/scripts/jquery.url.js", array('group' => JS_LIBRARY));
drupal_add_js("/scripts/jquery.cookie.js", array('group' => JS_LIBRARY));
drupal_add_js("/scripts/mymod.funcs.js", array('group' => JS_DEFAULT));
...
drupal_add_js("/scripts/otherfuncs.js", array('group' => JS_DEFAULT));

However, in D7, I am now getting the "$ is not a function".  Wrapping all my code as described in the D6 to 7 conversion wasnt't seeming to work since I was then getting "<one of my functions> is not defined".  Using

var $ = jQuery.noConflict();

at the start of my 'parent' file resolved the error.  But that doesn't seem like a good idea either.  Below is an example of the javascript.

//in main file: mymod.funcs.js, global functions
function my_storage(key) { return value; }

//in another file: otherfuncs.js
Drupal.behaviors.myMod = { attach: myMod_Splash }

function myMod_Display(splash) { ... }
function myMod_Splash() {
  var splash = my_storage('splash');
  if (splash) { myMod_Display(splash); }
}

What is wrong when simply wrapping all of it with the recommended? What else should be done, aside from converting the function groups to objects (which still wouldn't necessarily resolve the wrapping problem)?

EDIT: I was wrapping my code like:

//(function ($) { //tried here
Drupal.behaviors.myMod = { attach: myMod_Splash }

(function ($) { //and here
function myMod_Display(splash) { ... }
function myMod_Splash() {
  var splash = my_storage('splash');
  if (splash) { myMod_Display(splash); }
}
})(jQuery);

UPDATE: I just removed the "var $ = jQuery.noConflict();" from my file to begin messing with the problem again, and am now getting no errors at all, in Web/Error Console or Watchdog.  None of the code was wrapped.  I was constantly clearing cache in Drupal before so really have no clue what is going on now.  Could the JS aggregation still have been placing the files in the wrong group, hence loading in a conflicting order?


texts:
I have a module Block No Results which displays the no results data when block has no results.
Variable Api
if I will use the variable api then I need the 4 variables for a single block to keep the no results data and displays the results.
Custom Table
If I'll go with custom table then I'll keep the 6 fields in the table.

id - primary key

module - varchar(64)

delta - varchar(32)

status - tinyint(4)

content - longblob

empty_criteria - varchar

UNIQUE KEY md (module,delta)

KEY list (status,module)

Overview
On every block view I need to check that whether the block no results criteria is enabled for this block.If it is then I need to check what is the empty criteria and on the basis of that I need to perform action.

Problem
Variable api : If I'll use the variable api then on each block view I need to load the variables separately i.e. 5 variables load( ~5 database fetch queries)(if block no results is enabled) and 1 variable load(~1 query)(if block no results is disabled for that block).
As the variable api is integrated with the cache api so on the development sites usually get the results from cache.This seems to me not good approach in the case if a site has 100's of blocks.

Custom table
Load the whole row using the module & delta and take the appropriate action if needed.

Currently I have implemented this using the variable api.
Which approach should I use ? Is there any other better approach then these ?
how I can make it more better if you are going to suggest an approach ?


texts: Same CSS file generates under different folder when I flush

texts:
A question from a newbie:

I am using a theme in my site and I made some changes in the CSS file.
The CSS file I am modifyiing is Style.XcVzbo5GbrB4v7QVES377fts6uudS0o0YbaMpBamvPg1.css

and it is in the folder: /sites/default/files/less/1TKupTVXZyLFbxdskTDq5OyCMsRMsIZmPQc_nx40j0Y/sites/all/themes/XXXXXX/less

So when I flush the caches, a new folder named randomly like above appears in

/sites/default/files/less/

with the unmodified version of my CSS file Style.XcVzbo5GbrB4v7QVES377fts6uudS0o0YbaMpBamvPg1.css in it.

Where is the source of this Style.XcVzbo5GbrB4v7QVES377fts6uudS0o0YbaMpBamvPg1.css so I can modify it for ever?


texts:
I have found vague hints on the internet that we can speed up Unittests with an in-memory database by using the following line in our phpunit.xml file:
<env name="SIMPLETEST_DB" value="sqlite://localhost/:memory:"/>

However, this will not work for me. In the method BrowserTestBase::testLoad, I will run into the error Undefined index: value without any further explanation. With a MySQL database, everything works fine (albeit slowly).
What is the correct way to use an in-memory sqlite database for Unittests? Must I install something? Must I put something into the settings file? Is this feature documented somewhere?


texts:
I have (drupal 7) view where I have pagination with Ajax enabled.
When any pager item is clicked I want to perform certain thing after the view is reloaded with ajax.
I am trying the following code:

(function($){
Drupal.behaviors.myBehavior = {
    attach: function (context, settings) {
    $(document).ajaxComplete(function( event, request, settings ) {
        console.log("Ajax Completed");
    });
   }
 };

})(jQuery);

There is no output form console.log(). What am I doing wrong ?


texts: Is it possible to have a fallback widget for a custom field widget?

texts:
There's a similar question asked here: Use multiple widget types for one field but I was unable to reinstate the question with mine.

I have created a custom field widget with extended capabilities for authenticated users for a field. However the widget strongly relies on the person having a registered user account in the system, but I'd still like anonymous users to be able to input values for the field with the default widget. And to think of it, admins would have more use of the default one aswell.

The field is a customer_profile_reference field, so just rendering another type of field wouldn't work, I suppose (like text field instead).

Is there a way to fall back on the default widget with it's own validation when my custom widget has allready been initiated by being defined as the widget for the field in the UI? Basically I wish for an end result, where my widget would stay untouched if user is anonymous or has admin role, and another one is used.

Appreciate all and any help,

Alari


texts:
In the Drupal Commerce module is there a way to change the ADMIN ORDER EMAIL sender to the customers email instead of it being from the administrators email?

Thanks!


texts:
I'm reasonably new to Drupal... I've known about it for quite a number of years and have played around with it in the past, but only in the past 4 months have I started to make a serious website with it. Possibly a bit harder to configure than say WordPress, but so much more worth it when it's finished!

One thing that I'm trying to do is work with custom content types. What I am trying to do is create a custom content type called "Talk." In this I want to be able to specify a small description, an embed video URL and a link to PDF notes. I am having a really hard time to try and work out how to do that, and be able to customise it in a way I want.

What I want ultimately to be able to do is specify a HTML template for a custom field. That HTML then specifies where the fields appear (which may become problematic when there can be an undetermined number of entries for a particular field, but there could always be some way.)

Basically, let's say I specified the following

Summary: This is my summary
Embed: http://player.vimeo.com/video/51254497?title=1&amp;byline=1&amp;portrait=1
Notes: http://link/to/notes.pdf

I then want to be able to take those values and put them somewhere in HTML. For example...

[Summary]

Download corresponding notes

Is there any way that I can create a custom content type that would give me that much control over my field? I've had a look but haven't been able to find any way, even with a module (though there's a good chance I haven't seen the right module!)

Thanks for any help,
Josh.


texts: How to add classes to menu items in navigation twig template

texts:
I'd like to add classes to <a>-tags for menu items that have a submenu.

Currently this is my code, I can only add classes to <li> elements:

{{ menus.menu_links(items, attributes, 0) }}

{% macro menu_links(items, attributes, menu_level) %}
  {% import _self as menus %}
  {% if items %}
    {% if menu_level == 0 %}
      <ul{{ attributes.addClass('nav navbar-nav navbar-right') }}>
    {% else %}
      <ul class="dropdown-menu panel-collapse collapse">
    {% endif %}
    {% for item in items %}
      {%
        set classes = [
          item.is_expanded ? 'menu-item--expanded dropdown panel simple-dropdown',
          item.is_collapsed ? 'collapsed',
          item.in_active_trail ? 'active',
        ]
      %}
      <li{{ item.attributes.addClass(classes) }}>
        {{ link(item.title, item.url) }}
        {% if item.below %}
          {{ menus.menu_links(item.below, attributes, menu_level + 1) }}
        {% endif %}
      </li>
    {% endfor %}
    </ul>
  {% endif %}
{% endmacro %}


texts: How to disable 'promote to front page' and 'sticky' options?

texts:
Two possible methods that I have explored:

Use hook_form_alter to unset both options on node edit forms. But on the main admin content page, the options still appear under 'Update options' dropdown.

Use Override Node Options module. This provides granular control, but it means disabling the 'Administer content' permission. Users then can't see the 'Update options' at all, which they still need in order to bulk publish, delete, etc.


texts: Why administrator user makes the publish field of the node to zero?

texts:
when I access any node in my system by ADMIN user, after updating the content, it changes the published status of the content to zero. Why is it happening?

Is it something general?!


texts: Routing multiple params / paths to single method

texts:
I'm attempting to create the following routing :

/app/{type}
/app/{type}.{format}
/app/{type}/{limit}
/app/{type}/{limit}.{format}

I would like all of these routes to route to a single method. Do I need to declare a route for each of the paths and params ? Does the ranking of the routes also matter ? e.g do I have to place

  /app/{type}.{format}

first before

  /app/{type}

?


texts: GraphQL: GROUP BY / DISTINCT list of tags

texts:
How can I use GraphQL to get a list of unique tags associated with articles that match a given query?
I want to have a show a list of tags that are used by articles that have "drupal" in their title.
Without grouping, I need to fetch all tags of all articles via graphql, and then combine +
reduce the tags on the client side. This is very inefficient, because it could be 10000 articles that only have 2 tags in the end.
{
  tags: nodeQuery(
    filter: {
      conditions: [
        {operator: EQUAL, field: "type", value: "article"},
        {operator: LIKE, field: "title", value: "%drupal%"}
      ]
    }
  ) {
    entities {
      ... on NodeArticle {
        fieldTags {
          entity {
            entityLabel
          }
        }
      }
    }
  }
}

Response:
{
  "data": {
    "tags": {
      "entities": [
        {
          "fieldTags": [
            {
              "entity": {
                "entityLabel": "Drupal"
              }
            },
            {
              "entity": {
                "entityLabel": "Development"
              }
            }
          ]
        },
        {
          "fieldTags": [
            {
              "entity": {
                "entityLabel": "Drupal"
              }
            },
            {
              "entity": {
                "entityLabel": "Development"
              }
            },
            {
              "entity": {
                "entityLabel": "Hacking"
              }
            }
          ]
        },
     ....

I'm using Drupal 8.7 with graphql 8.x-3.0.


texts: how to download zip file through browser

texts:
I have written a module that creates a zip file in the /tmp and then downloads the zip file through browser i.e. it will be downloaded in the ~/Downloads directory by itself.

I don't want to use hook_file_download() because it executes everytime you try to download a file, but I want to be specific while downloading. The above code snippet is written in the same function that creates the zip file.

I have taken the help of davidwalsh blog to create the zip file.

I can create the zip file in /tmp directory, but how to download the zip file.

My code looks like this:

$fp = fopen($filesystem_filepath, 'rb');
header('Content-type: application/octet-stream');
header('Content-Length: '. filesize($filesystem_filepath));
fpassthru($fp);

At first I tried downloading simply using header() function and then after more googling I took the help of readfile($filesystem_filepath) instead of fpassthru($fp) but its not working.


texts:
I have a site with two books, each having about 300-350 pages each. I want to delete one of the book and its child pages.
I was able to load the pages using some custom coding. I also came across, node_delete() function which has the following code snippet:

db_delete('node')
  ->condition('nid', $nids, 'IN')
  ->execute();
db_delete('node_revision')
  ->condition('nid', $nids, 'IN')
  ->execute();
db_delete('history')
  ->condition('nid', $nids, 'IN')
  ->execute();
db_delete('node_access')
  ->condition('nid', $nids, 'IN')
  ->execute();

So, it deletes data from four tables; but I suspect there are other tables, from which the data needs to be deleted as well (one of them being book table). Could you please point out which of the tables needs to be checked?


texts: Handling anonymous orders in custom commerce module

texts:
Drupal: 8.7.2
Commerce: 2.13

I have a custom module set up that adds the following functionality to Commerce:

It prevents the user from adding more than one item to their cart.  If they try to add a second item, it removes the first item from their cart and adds the second item.
When clicking "Add to Cart", it redirects the user to a confirmation page.
On that page is a button that links to the order's checkout page.

I am handling all of these via queries that use the user ID and order ID to pull the correct order/cart information.

This all works great for logged in users.  Most of our customers will be anonymous, though.  It does work for anonymous users, but my concern is that if multiple anonymous users are placing orders at the same time, their carts will get mixed up, because all anonymous users have a UID of 0.

How can I better differentiate between anonymous user's carts?  Is there a way to store their IP in the database, and then use that?

Here is my module's code:

commerce_custom.module (handles removing first item from cart, redirecting to confirmation page):

<?php

use Drupal\Core\Form\FormStateInterface;
use Drupal\commerce_order\Entity\Order;
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * Implements hook_form_FORM_ID_alter().
 */
function commerce_custom_form_commerce_order_item_add_to_cart_form_alter(&$form, FormStateInterface $form_state, $form_id) {
   $form['actions']['submit']['#value']='Sponsor';
   $form['#validate'][] = 'commerce_custom_form_validate';
   $form['actions']['submit']['#submit'][] = 'commerce_custom_cart_alter_redirect';
}

function commerce_custom_form_validate(array &$form, FormStateInterface $form_state) {

    $user = \Drupal::currentUser()->id();
    $connection = \Drupal::database();
    $query = $connection->query("select * from commerce_order_item join commerce_order on commerce_order_item.order_id = commerce_order.order_id where uid = :user and state = 'draft'", [':user' => $user]);
    $result = $query->fetchAll();
    //dpm($result);

    $cart_count = $result[0]->quantity;
    $order_id = $result[0]->order_id;

    if ($cart_count > 0 && $order_id) {
        $order = \Drupal::entityTypeManager()->getStorage('commerce_order')->load($order_id);
        $items = $order->getItems();
        foreach($items as $item_key => $item) {
            $order->removeItem($item);
            $item->delete();
        }
    }
}

function commerce_custom_cart_alter_redirect(&$form, FormStateInterface $form_state) {
  $responce =  new RedirectResponse('/how-it-works');
  $responce->send();
}

ContinueCheckoutBlock.php (creates block with button linking to checkout page):

<?php

namespace Drupal\commerce_custom\Plugin\Block;
use Drupal\Core\Block\BlockBase;

class ContinueCheckoutBlock extends BlockBase {

   public function build() {

        $user = \Drupal::currentUser()->id();
        $connection = \Drupal::database();
        $query = $connection->query("select * from commerce_order_item join commerce_order on commerce_order_item.order_id = commerce_order.order_id where uid = :user and state = 'draft'", [':user' => $user]);
        $result = $query->fetchAll();
        $order_id = $result[0]->order_id;

        return array(
            '#type' =>'markup',
            '#markup' => 'Continue',
        );
   }
}


texts:
I need to migrate a CSV file of 3000 Taxonomy terms with depth of 5 levels deep.
This is a small sample of the CSV comma-separated values file.

About Us
About Us, Our Programs
About Us, Our History, Timeline
Mission
Mission, Community

I want these values to be inserted into a Vocabulary, It should have the depth and it should ignore parent terms it has already created. It should look just like this in Drupal

About Us
-Our Programs
-Our History
--Timeline
Mission
-Community

I created a simple migrate yml file that can do this but I had to restructure
the CSV file a lot and it is too much manual work. Can regex or something search
for the comma delimiter and make the term after a comma a child of the term in
front of it? And can it skip or ignore parent terms it already created? Here is my migration and csv file.

id: vocab
label: Migrate terms from the source CSV to taxonomy terms
migration_group: migrated_terms
source:
   plugin: csv
   path: 'public://csv/vocab.csv'
   header_row_count: 1
   keys:
      - uuid
   column_names:
     0:
       uuid: UUID
     1:
       vid: VID
     2:
       name: NAME
     3:
       parent: PARENT
destination:
   plugin: entity:taxonomy_term
process:
   vid: vid
   name: name
   parent:
      plugin: migration
      migration: vocab
      source: parent

csv file

"uuid","vid","name","parent"
"100","myvocab","About Us"
"101","myvocab","Our Programs","100"
"102","myvocab","Our History","100"
"103","myvocab","Mission"
"104","myvocab","Community","103"


texts: How to get a list of entities available in your Drupal?

texts:
Sometimes I need to create a new entity but I don't know the exact machine name of the entity to put in the entity_create() method.

Is there an easy way to check which entity types are available to create in your Drupal 7 site?


texts: I have created two webform as Vendor and Sponsors.There is two sponsorship type as gold and platinum in sponsors and each vendor is sponsors. Now i want to show in Vendor view the type of sponsorship this vendor have. Both are separate modules. I am not able to understand how to do this.


texts: Associate multiple Profile2 profiles with vocabulary and expose the vocabulary's terms in a views' filter

texts:
I have 2 profiles that have two different taxonomy term fields that point to the same vocabulary (the reason that I created 2 different fields instead of one is that I want the users that handle the two profiles to be able to select different amount of vocabulary terms). If I try to create an exposed filter (select list) in views 3 I can only create 2 different exposed filters: one for profileA and one for profileB. I want to be able to merge them into one.

The "Global Combine Fields" option does not work since I want to expose a select list and not an input field. All the relationships that I tried to create are specific to one field or another (and not to the targeting vocabulary for example).

My question is: can I create an exposed filter based on the vocabulary (instead of the fields) that will filter the profiles based on whether the specific term(s) that were selected are in either the profileA's field and profileB's field?

I would like to know whether this is possible directly in views 3 with a method that I'm missing or if I could create a custom exposed filter programmatically. If the answer is the latter, I would really appreciate if you could point me to an article that shows how you can create such an exposed filter (or a similar) since I do not have any experience at all in the specific field.


texts:
Is there any hook for when the node_load or node_load_multiple functions are called, but before they are actually loaded from the DB?

I need this because I want to cache my nodes before Drupal goes and queries the DB for them.


texts: How to replace a preprocess function entirely?

texts:
I need to replace template_preprocess_links with my own preprocess function and I can't find in the documentation how to replace a preprocess function entirely. Here is my current HOOK_theme implementation:

/**
 * Implements hook_theme().
 */
function my_module_theme($existing, $type, $theme, $path)
{
  return [
    'links' => [
      'variables' => [
        'links' => NULL,
        'raw_links' => NULL,
        'attributes' => NULL,
        'heading' => NULL
      ],
      'override preprocess functions' => TRUE
    ]
  ];
}

But even with override preprocess functions set to TRUE, the core template_preprocess_links is still called and pollute the output with rendered links.

How can I replace this preprocess function entirely?


texts:
When going to node/add/my-content-type there is only a field for editing the title. There are body and FileFields attached to this content type but they are not being displayed until after I click save.

The content type is an OG content type though I am not sure this has anything to do with the issue. I tried toggling strict node access but it didn't help.

Preview is disabled.


texts:
I'm using drupal_mail for sending eMails from a custom module. This is the code:

function changeme_node_update($node) {
...
$to = "receiver@example.com";
$from = "sender@example.com";
$subject = 'sampletext ' . $nodedate;
$body = "Dear " . $user_name . "! \r\nSome more text\r\n\r\n" . $nodetitle . "\r\nDate:" . $nodedate . "\r\nTime:" . $nodetime . " h";
$body .= "\r\n\r\nSome more text here";

//call mail function
$params = array(
    'subject' => $subject,
    'body' => $body,
);
drupal_mail('changeme', 'information', $to, "de", $params, $from);
...
}

function changeme_mail($key, &$message, $params) {
  switch ($key) {
    case 'information':
      $message['subject'] = $params['subject'];
      $message['body'] = $params['body'];
    break;
    }
}

I'm receiving emails with the subject but the message is missing. Also, where to change the encoding?

Thanks!


texts: Custom view handler argument to filter out child nodes

texts:
I need to create a custom contextual filter in Drupal 8 to render all the child nodes of a Parent node inside the block view. The child node having an entity reference field.

E.g:

----------View Block--------------

Parent ID:

Child 1, Child 2 , Child 3....


texts: Ability to create forms for each node in Drupal 7

texts:
I am creating articles in which I want to ask, on each article, that whether the it was helpful to read or not.

The user would have two option boxes:-

© Yes

© No

One of these will be selected and the form should be submitted through JQuery. It should be recorded with each node so that we would also know how many total users found this helpful too?

Any idea how would I achieve that?

I wish it could be achieved through Flags or Rating but I haven't been able to do so.

Thanks a lot


texts: How to autoload, so composer packages work correctly?

texts:
I'm trying to load in a composer package: archwisp/php-encrypt-data, and while I'm able to use it in a test php script, using it in Drupal itself doesn't seem to be working.

This is the test script:

require __DIR__ . '/vendor/autoload.php';

$encryptionKey = 'IyJQdVtyNClqQ+ybuxHWNhJnw93ocxJuLruRztQPNI0=';
$macKey = 'pbJqXp4YhhtRYv/Ntt/i+O4KbO1F4/2bktO08m0+Exo=';

$phpcrypt = new \PHPEncryptData\Simple($encryptionKey, $macKey);

$ciphertext = $phpcrypt->encrypt('Foobar');

echo $ciphertext . "\n";

echo $phpcrypt->decrypt($ciphertext) . "\n";

But, I don't understand what I have to do in a Drupal class to make this work.  I tried to use archwisp\PHPEncryptData; at the top of the file, and I tried doing require DRUPAL_ROOT . '/vendor/autoload.php'; as well, but no matter what, it always says: Call to undefined function PHPEncryptData\\mcrypt_get_key_size()

Is it because it didn't do the autoload the same way, or is it getting mixed up because of namespaces?  The error is coming from the composer package itself, so it is locating that, but for some reason it's not calling the mcrypt function correctly, even though the extension is enabled and working in the test script.


texts: Composer is git cloning modules instead of download them?

texts:
My composer file looks as follows:

{
    "name": "drupal/drupal",
    "description": "Drupal is an open source content management platform powering millions of websites and applications.",
    "type": "project",
    "license": "GPL-2.0+",
    "require": {
        "composer/installers": "^1.0.21",
        "wikimedia/composer-merge-plugin": "~1.3",
        "drupal/drupal-extension": "~3.0",
        "drupal/search_api": "1.x-dev",
        "drupal/search_api_view_modes": "1.x-dev",
        "drupal/paragraphs": "^1.0",
        "drupal/features": "3.x-dev",
        "drupal/robotstxt": "^1.0",
        "drupal/search_api_solr": "1.x-dev",
        "drupal/metatag": "1.x-dev",
        "drupal/pathauto": "1.x-dev",
        "drupal/acquia_connector": "^1.4",
        "drupal/sharethis": "2.x-dev",
        "drupal/field_group": "1.x-dev",
        "drupal/ckwordcount": "^1.0",
        "drupal/menu_link_attributes": "1.x-dev",
        "drupal/yaml_editor": "1.x-dev",
        "drupal/devel": "1.x-dev",
        "drupal/menu_block": "^1.4"
    },
    "replace": {
        "drupal/core": "~8.2"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },
    "repositories": {
        "drupal": {
            "type": "composer",
            "url":  "https://packages.drupal.org/8"
        }
    },
    "extra": {
        "_readme": [
            "By default Drupal loads the autoloader from ./vendor/autoload.php.",
            "To change the autoloader you can edit ./autoload.php."
        ],
        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "merge-extra": false
        },
        "installer-paths": {
            "modules/contrib/{$name}": ["type:drupal-module"],
            "themes/contrib/{$name}": ["type:drupal-theme"]
        }
    },
    "autoload": {
        "psr-4": {
            "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
        }
    },
    "scripts": {
        "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
        "post-autoload-dump": "Drupal\\Core\\Composer\\Composer::ensureHtaccess",
        "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
        "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
    }
}

For all the modules that were downloaded as a 'dev' status, they appear to have been git cloned. Therefore, the changes aren't recognized or saved to my git tree, and don't push. These modules did not make it to my remote repository, and did not show up on the remote website.

I am not sure how this occurs, but for time being, I had to:

cd into module directory
rm -rf .git folder
git rm --cached modulename
git add modulename
git commit -m "Adding module"
git push

The module(s) then make it into my project repository and make it up to the remote server.

What is the correct workflow here? I am not running any build process or tool remotely but want to retain my project build with composer tracking the modules and themes I have installed.


texts: how to use Profile information for payments

texts:
I am using the customer_profile_type_ui as a way of displaying different checkout pages for different types of purchases. (this is the exact scenario which the readme file described as its use, and I followed it). But now I have an issue: payments. I am using the Authorize.net contrib, and it says in its home page -

  The Payment checkout pane must come after the Billing information checkout pane for Drupal Commerce to be able to populate the order used to generate transactions with a billing address before this module attempts to process payment.

When you follow the profile_type_ui readme, it says to use rules to disable all panes (which would include 'billing information' and then enable the appropriate profile pane. I followed this advice, because the billing pane didn't have all the fields I wanted.

When I looked at the email invoice (developer email), it did not have values for the billing information, as expected (or shipping, but I'm selling memberships, so we wont be using shipping).

The only possible thing I saw was a checkbox on the billing page settings page which said

  Enable profile copying on this checkout pane, helping customers avoid having to enter the same address twice.

but it didn't do anything. Any ideas?


texts:
I have defined some extra fields for User information in configuration > account settings > manage fields.

One of these fields is of type List (text) and the widget I have chosen for it is Select List.

I want to display this field using Select List widget in Profile Edit Form but as Check boxes/radio buttons in User Register Form.

How can I do so?


texts: How to edit a profile field from the node add form

texts:
My client has a user field field_geolocation of type  Geofield.

And he has a content type issue, he allows people to create new issues (kinda like in drupal.org but private).

What he wants is: When someone is creating a new issue, he should be able to to set/edit the field in his profile identified by field_geolocation.

My guess: create a custom module which does the following

Inject a widget for the user field field_geolocation inside the node add/edit form, prbably with FAPI
Use Node API to save the data collected previously into the actual user.

Did I guess right? Or any better solutions?

Thank you.


texts: How to display both the taxonomy parent and child in a node?

texts:
I have a simple two-level taxonomy in my site: parent level is responsible for the "kind of place" (wine bar, restaurant...), and the children terms make more precise disintctions (french, italian etc. for restaurants).

Now, if i display a taxononomy term, only the child appears (only "french", not "Restaurant French").

Is there any way to display both of them? I've found this http://drupal.org/node/1532198
but I am not sure how to use it.

Maybe there's a module that is more universal way, or a module that manages the display of the terms?


texts: "Cannot use a scalar value as an array" error

texts:
I'm getting a bunch of PHP errors every time the cron runs. I can't seem to track down what is causing them all.

  Cannot use a scalar value as an array in drupal_render() (line 5822 of /var/www/vhosts/tlthost.net/httpdocs/includes/common.inc).

  Cannot use a scalar value as an array in drupal_render() (line 5767 of /var/www/vhosts/tlthost.net/httpdocs/includes/common.inc).

  Invalid argument supplied for foreach() in element_children() (line 6300 of
  /var/www/vhosts/tlthost.net/httpdocs/includes/common.inc).

  Cannot use a scalar value as an array in adaptivetheme_page_alter() (line 235 of
  /var/www/vhosts/tlthost.net/httpdocs/sites/all/themes/at_core/inc/alter.inc

  Cannot use a scalar value as an array in user_relationships_ui_page_alter() (line 247 of
  /var/www/vhosts/tlthost.net/httpdocs/sites/tlt/modules/user_relationships/user_relationships_ui/user_relationships_ui.module).

  Cannot use a scalar value as an array in fbconnect_page_alter() (line 568 of
  /var/www/vhosts/tlthost.net/httpdocs/sites/all/modules/fbconnect/fbconnect.module).

  Cannot use a scalar value as an array in block_page_build() (line 269 of
  /var/www/vhosts/tlthost.net/httpdocs/modules/block/block.module).

I'm hoping you know what's causing this one. it might help me figure out the rest of the errors.


texts: How to call function in mail which is configured using Rules in drupal

texts:
I want to call function in mail body. I am using Rules modules for sending mail on some event triggers.

anyone have idea, how can i achieve this?


texts:
I just had a terrible learning experience. I spent several days building up a bunch of views, only to find that they vanished entirely from my site when I synchronized my configurations to handle another issue. They're gone. I have a dump of the db, but they're not on there either.
The funny thing is that not all of the views are gone. Some that I made several weeks ago are there, but the more recent ones are irrevocably lost.
And yes, I clicked "Save" on each view when I was creating it.
How can I be sure that this never happens again? What steps do I need to take save the views permanently in the db?
Version: Drupal 8.9.6


texts: alter/remove taxonomy term path if no related nodes

texts:
I'm using taxonomy menu and nice menus to generate the page main menu. Not every term has related nodes, but the customer wants them all to be in the menu, but the "empty" terms not clickable. And when he creates nodes related to these terms, the terms should turn in to links.
Can I achieve that with hook_page_alter? Or is there a better hook to use.
I first tried hook_url_outbound_alter, and I was able to rewrite the path, but it's still a link, and I want to avoid that.
I know how to use rendered arrays, but this one is a bit tricky for me.


texts: image style (imagecache) images are not being created

texts:
Currently i am unable to create images that get resized automaticaly according to the different image styles.

This includes the default styles such as thumbnail as well as the custom created styles.

I have checked the "Public file system path" as well as the "Temporary directory" (under Configuration > File system).

Both of the directories exist.
The file permissions are good on the directories (777).

The original file that's uploaded gets created.
It's just the scaled images that aren't getting created.

Any help with this problem would be very welcome.
If there is already a solution somewhere (which means i searched for the wrong terms), a link to that would be very appreciated.

edit:

I can't find anything in the logfile either, except for messages like :

type : page not found

message: sites/default/files/styles/thumbnail/public/fotoslider/slider_images/testbeeld20130103005.jpg


texts: actually i am new to drupal and i have migrated my drupal site from 8 to 9. This site is multi site, every thing is working fine but the issue is related to the images. When i cleared the cache using drush cmd and load first domain site(i.e example.com) getting all the images, when load on the second domain site(i.e examplelocal.com) not getting all the images. When i cleared the cache again load second domain site(i.e examplelocal.com) first this time all the images getting, When i load the first domain site(i.e example.com) not getting all the images. After clearing cache, which site is loaded first getting all the images the other site is not getting. Presently i am working on local. I tried to clear cache using the drush cr specific url. But it is not working. Could you help me in solving this issue. Thanks in advance.


texts:
I would like to download the stable version of a project and apply a patch. This patch was not submitted but applied directly to the project. I have the following drush make file (just a test snippet)

; Drush make script for the level platform install profile and features
core = 6.20
api = 2
projects[drupal][type] = core

projects[flot][dir] = "contrib"
projects[flot][version] = "1.2"
projects[flot][patch][] = "http://drupalcode.org/project/flot.git/patch/0b9d38d28e9f66cee239e7f92ccd2a368ce377c7"

This tells me that the patch has failed. If I download the file and use patch -p0 it will patch correctly.

Anyone have an idea why this is not working, and how to fix it?


texts: How can I add a custom currency to commerce?

texts:
I'm trying to add a custom currency (like points) but I can only choose the "real world" currency. Can I change the currency in commerce or I have to do it with a module? If so, which module should I use? Thank you !
PS: I have to do it in commerce, is for a school project


texts: How do I add a header to the contact form?

texts: I want to add a text header to the core contact form (between the title and the "Name" field). How can I achieve this?


texts: Drupal 7: how to show the main menu to anonymous users?

texts:
I've installed drupal 7  with cartaro (its shares its login system with geoserver).

I created some pages and book entries: I choosed to display some pages in the main menu (I clicked on 'provide a menu link' when editing those pages).

The links shows in the main menu if I'm logged in, but they remain invisible for anonymous users. Where are the settings to force the main menu to be visible for anonymous users?

In Administration/People:permissions, I checked "View published content" for anonymous users.

---- Additional description following comments ----
Originally I had both Appearance/mytheme/ main menu toggled in "toggle display" AND a menu block added to the theme: menu visible only for logged user, not for anonymous.
If I toggle off the main menu in Appearance/toggle display of the menu theme: even the logged user can't see the menu.
I think therefore that only the main menu from the theme appearance actually shows up, the menu from strucutre/blocks won't show up in any case.


texts: How can you gitignore items in a Drupal project without modifying core?

texts:
I have a Drupal project, and we want to use Git for version control, but we need to have some folders that are ignored by Git. The problem is that .gitignore seems to be a core file. After the last "drush up" command, the gitignore file was replaced.

So, other than asking each developer to manually add entries to his or her global .gitignore file, is there a good way to effectively .gitignore a path in Drupal?


texts: how to remember results of a views query in rules

texts:
I have a site with an eva view that is embedded into a view page that is directly accessible, running the query for the first time. To that I have added rules_views, I want to e-mail out certain fields values of the view when the user requests it using a flag. (as the trigger) But I want to e-mail the field values out after the query is first run, with the original values. I want to preserve the state.

What is the best way to do this?


texts: How do I import configuration without getting these errors?

texts:
I am using drush cim and drush cex for importing and exporting the  configuration between environments.

At this moment, local and develop are working OK, but I am getting an error on stage.

This is the error.

  The import failed due to the following reasons:
  This config does not have system.site, rejected
  UUID source site does not match current site.

  Config core.extension does not exists.

But actually both of them exists. I have already ran drupal config.override and set the UUID on system.site, but I am still getting those errors.

I have also tried drush cr.

The system site has the same UUID as local. It's the same file.


texts: Add field to display in views using a custom table

texts:
I joined a custom table in an existing Views (using hook_views_query_alter) and now I'd like to display fields from this table.

Any idea how to do it ?

Thank you


texts: Return a view's total_rows in Drupal 7 without php filter?

texts:
Is it possible to list the total number of rows in a view into the header of the view, without enabling the PHP filter? I know I can enable the PHP filter and output $view->total_rows in a header, but I'd like to avoid enabling the PHP filter.

I could use the output $view->total_rows in a template file but is there an existing handler or other trick I'm missing?


texts: Search box using Googles places API to search Leaflet map

texts:
I'm setting up a business directory for Bangkok with hotels based on the BizReview theme/installation profile.

SETUP
Content type
In order to store bussiness locations I use a content type with a field using a Geofield field type provided by the Geofield module with a Google map widget provided by the Gmap module.
Map
On my homepage I have a Leaflet map view with Format set to Map (Leaflet API, via IPGV&M) (provided by the IP Geolocation Views & Maps module) listing all the businesses added with the business content type.

MY NEED
I would like to add an auto-complete search box to search the map on my homepage, like the one on google maps. I tried to find a module for this but couldn't find one. I only found modules that add a field to a content type (e.g. Google Places for Drupal. The Geofield Gmap module basically does what I need but on a content type instead of a map. If I add a business I can use the ''Geocode address'' field to lookup a location and the location gets displayed in a map (see image on the module page).

SOLUTIONS?
1. Is it possible to reuse the search field provided by the Geofield Gmap module on the map on my front page so that visitors can search for a place in Bangkok and see all the hotels that I added that are nearby? Maybe with views or a hook & custom field template.
2. Is there a module for this (I searched but couldn't find one)?
3. Can I use Google Places API and a Places search box and add the html for the search box and the classes to the html of my map. Or would this require more modifications (my knowledge of PHP is limited but good enough to implement hooks and make a template).

Any help would be much appreciated.
Jasper


texts: Commerce Coupon "create coupon" link goes to empty white page

texts: So, I'm trying to add a simple percentage based coupon to a D7 site with the latest version of Commerce. I'm using the 7x-1.0beta7 version of Commerce Coupon and there seems to be a problem with UI. I have the module and all dependencies install, but when I try to navigate to the "Create Coupon" page from Admin =>Store => Coupon, get get taken to a white page with empty html at this URL admin/commerce/coupons/add. I can still add coupons through the "configure" button on the installed modules page, but this seems like a circuitous and round-about way of getting the necessary functionality. Any ideas on what's broken or how to fix it?


texts: I am trying to create a store using Ubercart. like most other things on my site, I have a large amount of data stored on a csv file that I downloaded out of PHPmyAdmin from another site (the clients original site), which I need to upload into my new site. I am trying to upload them as products, but the problem is that things like the "List Price", the 'cost", the "sell price", and "SKU" number are entities, and those fields don't show up in the feeds importer. is there a way to import feeds into an entity as well as a field?


texts:
Drupal 6 site running on remote server.

I created a View of the User type. Then I create a display to show all users of my site.
I set the Style of the display to Bulk Operation and in Selected operations I checked: Send e-mail (system_send_email_action)

In Fields I added the User: E-mail E-mail and other fields

Now I go to the path where I can see my users, I select one user (John) and click in send email under Bulk operation. I continue to complete a send the email and finally I get the message: 1 rows processed in about 23 ms:
Performed Send E-mail on user John.

I understand that the email is sent to John user email from the administration site email.

But I don't receive the email. The email is not really sent.

I have a Webform node in my site which send email with no problems. So, I know there is nothing wrong with my server setting.

Thanks for any help


texts:
In the design for my article pages I have related links in a right hand side column.

In Drupal administration when you edit content I want to have a 'Related Links' section, which prints a list of the content currently on the site with checkboxes so a user can choose which pages should be displayed as related.

I'm new to Drupal development, however have experience in working with PHP/mySQL and writing modules for other content management systems.

What steps should I go about to achieve this? And how would I then print the selection on the front-end of the site?

Thanks so much for your time


texts: Getting a blank screen after copying project in my server

texts:
I am fairly new to Drupal.

I just got an already existing Drupal project and want to install it.

I copied it to: /var/www/html/myprojects/mydrupalproject

Then I got this error in my error.log from apache2:

  [Thu May 03 17:55:41.603774 2018] [php7:notice] [pid 11604] [client
  127.0.0.1:41930] PHP Notice:  Constant DATE_RFC7231 already defined in /var/www/html/myprojects/mydrupalproject/includes/bootstrap.inc on
  line 258, referer: http://127.0.0.1/myprojects/

  [Thu May 03 17:55:41.604601 2018] [php7:error] [pid 11604] [client
  127.0.0.1:41930] PHP Fatal error:  require_once(): Failed opening required
  '/var/www/html/myprojects/mydrupalproject/profiles/clusters_public/modules/contrib/apc/drupal_apc_cache.inc'
  (include_path='.:/usr/share/php') in
  /var/www/html/myprojects/mydrupalproject/includes/bootstrap.inc on
  line 2632, referer: http://127.0.0.1/myprojects/

So I tried to use the original .htaccess info in case it was the problem but I still get exactly the same error in the log. Any help?


texts: I have created a form using webform and used in views to display filled entries. Now I want to make full text search which can search data from available data in webforms. I have tried to index webform field but there is no webform type in index type in search Api. Please help, how can I do this?


texts:
My team is working on a simple message notification using the message stack but a bit tricky to implement.

The goal is when a user is subscribed to content, a notification message will be delivered to the user's email address.

We are trying to follow this steps, doing the configuration in the browser. But the last step, we think should be added manually in a certain file as mentioned in this comment.

Questions:

Where should I add the code to properly send the message into email?
Is there a need to create a custom module to achieve it?


texts: Views date range filter adds weird condition

texts:
I have a view for a content type. This content type has a date field (only date) and I have added and exposed a filter for this field ("date is between" option).
I have added and exposed a filter for other text field.
If I put a condition on the text field in the filter of the view, then it generate a weird SQL for the date field.

SELECT node_field_data.nid AS nid, node_field_data_node__field_liq_club.nid AS node_field_data_node__field_liq_club_nid
FROM
node_field_data node_field_data
LEFT JOIN node__field_liq_club node__field_liq_club ON node_field_data.nid = node__field_liq_club.entity_id AND node__field_liq_club.deleted = '0'
INNER JOIN node_field_data node_field_data_node__field_liq_club ON node__field_liq_club.field_liq_club_target_id = node_field_data_node__field_liq_club.nid
LEFT JOIN node__field_liq_ejercicio node__field_liq_ejercicio ON node_field_data.nid = node__field_liq_ejercicio.entity_id AND node__field_liq_ejercicio.deleted = '0'
LEFT JOIN node__field_liq_fechaliq node__field_liq_fechaliq ON node_field_data.nid = node__field_liq_fechaliq.entity_id AND node__field_liq_fechaliq.deleted = '0'
LEFT JOIN node__field_liq_fechapago node__field_liq_fechapago ON node_field_data.nid = node__field_liq_fechapago.entity_id AND node__field_liq_fechapago.deleted = '0'
WHERE
(node_field_data.status = '1') AND (node_field_data.type IN ('liquidacion')) AND (node__field_liq_ejercicio.field_liq_ejercicio_value = '2010') AND
((DATE_FORMAT(node__field_liq_fechaliq.field_liq_fechaliq_value, '%Y-%m-%d') BETWEEN DATE_FORMAT('2019-01-01T00:00:00', '%Y-%m-%d') AND DATE_FORMAT('2019-12-31T00:00:00', '%Y-%m-%d')))
AND ((DATE_FORMAT((node__field_liq_fechapago.field_liq_fechapago_value + INTERVAL 7200 SECOND), '%Y-%m-%d\T%H:%i:%s') BETWEEN DATE_FORMAT(('2018-12-31T23:00:00' + INTERVAL 7200 SECOND), '%Y-%m-%d\T%H:%i:%s') AND DATE_FORMAT(('2019-12-30T23:00:00' + INTERVAL 7200 SECOND), '%Y-%m-%d\T%H:%i:%s')))
LIMIT 25 OFFSET 0

My text field add the condition:
node__field_liq_ejercicio.field_liq_ejercicio_value = '2010'

But, although I don't fill any condition for date-range, it adds:

    and ((DATE_FORMAT(node__field_liq_fechaliq.field_liq_fechaliq_value, '%Y-%m-%d') BETWEEN DATE_FORMAT('2019-01-01T00:00:00', '%Y-%m-%d') AND DATE_FORMAT('2019-12-31T00:00:00', '%Y-%m-%d')))
AND ((DATE_FORMAT((node__field_liq_fechapago.field_liq_fechapago_value + INTERVAL 7200 SECOND), '%Y-%m-%d\T%H:%i:%s') BETWEEN DATE_FORMAT(('2018-12-31T23:00:00' + INTERVAL 7200 SECOND), '%Y-%m-%d\T%H:%i:%s') AND DATE_FORMAT(('2019-12-30T23:00:00' + INTERVAL 7200 SECOND), '%Y-%m-%d\T%H:%i:%s')))

I don't know why it is added, and how to solve this issue. Why this INTERVAL 7200 SECOND?. Any suggestion?


texts: When old field revisions should be deleted from the database?

texts:
I have a question about old fields revisions in Drupal 8. For example I have "Full Title" field in different paragraphs. I have deleted this field from one of the paragraphs, for example from the "Test Paragraph". In the database there are tables: paragraph__field_section_full_title and paragraph_revision__field_section_full_title. In these tables all of the records for test_paragraph bundle deleted column values changed from 0 to 1.
After the field_cron() that should delete these records all of the records from paragraph__field_section_full_title was deleted as it expected.
But in the paragraph_revision__field_section_full_title table old revisions for test_paragraph bundle whith deleted column = 1 is not deleted. When they should be deleted? Is it automatic process or not? Where I need to look to check if abything broken?
Thanks.
Here screenshot below of the table of not deleted old revisions:


texts: how to wrap drupals taxonomy term node list in a div

texts:
i need to wrap the nodes teaser in a div for my taxonomy term page but cant figure out how.

this is my page , this is a list of nodes for the products taxonomy term, using node--product.tpl.php i warped the individual node in

 but now i need to wrap the list of nodes in

 and just for the products taxonomy term page listing ...

how can i do this ???


texts:
We've been managing a Drupal 6 based content rich site for almost 8 years now. Now, client is planning to move from Drupal 6 and seek out different possibilities. What they want is a service oriented approach so that the site can provide services to the end points like any 3rd party or a mobile app. The UI can be built with any available JS framework (angular etc.).

While thinking of this, we came up with using Drupal 8 as the underlying framework.
The a very basic architecture diagram is as follows:

There are some PROS & CONS to consider.

Why Drupal

Since the site is in D6, it will be easy to migrate to D8 compared to other frameworks like Laravel or Symfony.
Drupal provides many functionalities out of the box (we all know it).
Drupal 8 has REST support in CORE.
Drupal 8 overcomes headless hurdle compared to it's predecessor.

Why we are not feeling lucky

This is where I need some help from the members in this forum.

Drupal 8 views rest_export provides a JSON representation but how to restrict fields? Say, I don't want to display the body field in the response.
How to implement custom Rest web services in Drupal 8?
Is it possible to version the API? Say, api.example.com/v1, api.example.com/v2 and keep both so that other 3rd party can use any.
How mature is Drupal 8's REST API before Drupal 8.2.x? There are many issues in the issue queue for REST.


texts: Alternative link to download modules from drupal.org

texts:
I am unable to download these modules for Drupal 7. It shows the "Not Found" error.

https://www.drupal.org/project/search_api_solr
https://www.drupal.org/project/fuzzysearch

Is there an alternative link to download these modules?


texts: Stylesheet for specific page overwritten by standard css

texts:
In my subtheme.info I have :

stylesheets[all][] = css/style.css

And in my template.php I have:

function subtheme_preprocess_page(&$vars) {
    $path = current_path();

    if ($path == 'user/login') {
        drupal_add_css(drupal_get_path('theme', 'subtheme') . "/css/login.css");
    }
}

But when I load the page, my style.css is declared after my login.css. So my styles in login.css are overwritten by styles.css. How can I make sure the login.css is declared after the styles.css?


texts:
Ok so I've got this view, and it has a few dozen items. I want the last 3.

Sort ascending seems to work, however the events are in the opposite order than I want.

Sort descending pulls events back from June.

Is there any way to pull the events, but order them differently with views?


texts: Pass variables from controller to existing node template file

texts:
In the Drupal 8 documentation I have found a way how to pass variable from controller to custom twig template

https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-from-custom-module

test_twig.module

function test_twig_theme($existing, $type, $theme, $path) {
  return [
    'my_template' => [
      'variables' => ['test_var' => NULL],
    ],
  ];
}

TestTwigController

class TestTwigController extends ControllerBase {
  public function content() {

    return [
      '#theme' => 'my_template',
      '#test_var' => $this->t('Test Value'),
    ];

  }
}

But is there a way to pass variables from controller to already existing node template, for example to node--custom_content_type.html.twig


texts: How to style nested paragraph fields without duplication, in Views (and nested fields appear)

texts:
Drupal 8.. This may be a two-part problem. I want to avoid repeated content due to multiple values in a nested paragraph reference, but ALSO put the nested paragraph fields into a custom text field, so I can change how they're rendered.

I have a content type "episode", with a field referring to paragraph "section", containing several fields. One of those fields inside "section" is a nested reference to a paragraph called "source".

I created a view for content type "episode". It pulls the results of "Section" matching a content ID  contextual filter. Then I added a reference to the paragraph "section", so I could get individual fields instead of a fully rendered value (I want to do this myself in a custom text field). I also created a reference for the "source" paragraph, to the "section" paragraph.

I'm able to add all the paragraph and nested paragraph fields, but the nested "source" fields are showing blank in the preview below, and it duplicates entries based on number of 'sources' I confirmed the paragraph fields are all set to show in the "manage display" for both paragraphs.

I then tried to see if there was a way I could just use the rendered paragraph "source" on the page. This shows the information, and I can set it to "Display all values in the same row" to eliminate duplicates.

But this prevents exactly what I'm trying to do: custom style the presentation of the information

What I want is to end it all with a custom field something like this:

{{ field_section_timestamp }}

{{ field_section_title }}

{{ field_section_description }}

Sources

{{ field_source_author }}{{ field_source_title }}

...And then apply whatever settings that get the sources to show as a list and not duplicate the entire section over-and-over, giving me something like this:

Episode
 - Section 1
    - Source 1
    - Source 2

 - Section 2
    - Source 1
    - Source 2

I know this can be done with the rendered paragraph and multiple field settings checked to "display all values in a row" But...

What I need is change how each field in Paragraph B is rendered - changing the tags.

But when I try to do this by adding the paragraphs as relationships and using individual fields, I get the repeating issue described above. I added the fields to a custom text field with everything, but this generates repeats.

Episode
 - Section 1
    - Source 1 (value blank)

 - Section 1
    - Source 2 (value blank)

 - Section 2
    - Source 1 (value blank)
 - Section 2
    - Source 2 (value blank)

Actually... as I'm typing this out and testing, I'm seeing that the paragraph B values aren't even showing at all. Though they take up space. just no content.

Hopefully this gives enough of a starting point for the question?


texts:
I had set a content type to allow it to be used as a simplenews newsletter, and then updated the JSON Feeds Processor so that it filled in the simplenews category for all the items.

However after realizing this wasn't what I needed, I removed the field simplenews from the content type and removed the option "use as newsletter" too, but all the newsletters still show up in the admin page.

I want to delete all of these old newsletters but there doesn't seem to be any option in the module to do that ?


texts: 3 domain names for one instance of Drupal 8

texts:
We are currently developing a website on Drupal 8.

This site will be 3 versions . The difference between each site is minimal :

Different logo
Different colors CSS ( HTML structure remains the same ) .
Some content is filtered according to the domain name . For this, we created a selection field in the content type to know on which domain name the content appears (checkbox  Site A , checkbox Site B,checkbox  Site C. A content may appear in several versions , the choice is multiple)

Our question is : what is the best way manage this type of project with Drupal 8 ? We are aware that this could cause problems at the Drupal cache if we do a simple detection via preprocess to load a particular CSS or content.


texts: How do I get the user ID for the currently logged-in user?

texts:
I want to get current user object (user information) in Drupal 8.

I know in Drupal 7 there was a global $user variable; I want to know how I can get current user object in Drupal 8.


texts:
I have a Drupal site and my problem is that it doesn't display error messages when authenticated users are filling in, but they display with the administrator users.

An example of the messages I am referring to is "image size too exceed […]."

How can I make the error messages appear for every users?


texts: How can I invoke a custom submission handler for a view field?

texts:
I would like to display a button for each content displayed in a view.
In a custom module, I have added a custom submission handler to the edit form (hook_form_FORM_ID_alter()) and defined the action on click (a field value is modified and the content is saved).
I'm missing the last step: Call the custom submit handler in a view field so that the button appears on each element of the mosaic.
Basically, the end user can click on the button of each content to decrease the quantity of content to 0 and make it disappear from the list (another custom module takes care of it).
How do I display this button linked to the custom submission handler in a view?