texts: Theme and sub theme template.php files appear to be ignored

texts:
My company purchased a theme, "Porto" which also has a subtheme, "Porto Sub". Porto had a template.php file, Porto Sub, did not. This is all in Drupal 7.

I wanted to make a change to the porto_menu_link() function so that I could support nolink menu entries. Best practice seemed to be to make those changes in a template.php file under the themes\Porto_sub\ folder. I created a template.php file in that location and added this content, almost all of which I had copied from the porto_menu_link function from the original themes\Porto\template.php:

<?
function porto_sub_menu_link(array $variables) {
  unset($variables['element']['#attributes']['class']);
  $element = $variables['element'];
  static $item_id = 0;
  $menu_name = $element['#original_link']['menu_name'];

  ... snipped some code out here ...

  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . '</li>';
}

?>

But my function was not not being called. I thought it might have something to do with it being a sub template, so I altered the same code in porto_menu_link in the original themes\Porto\template.php. Still no dice. I even deleted the porto_menu_link function in template.php and it didn't change anything. I cleared caches between all steps and I'm essentially out of things to try. Anybody know why this wouldn't work?


texts: How can I make entityQuery('commerce_order') return completed orders?

texts:
Under Drupal Commerce 8.x-2.13 I find that the query

Drupal::entityQuery('commerce_order')

with no conditions attached returns ONLY incomplete orders (when called in the context of an API endpoint) - and if I apply any parameters exclusive of incomplete orders such as

$query->condition('state', 'completed');

it returns nothing. How can entityQuery be made to retrieve data on completed orders?


texts: How to create a Webform pre-build option list via a query to an external database?

texts:
I'm trying in Webform (version 4.9) to create a pre-build option list with data from an external database. A pre-build option list is an available list you get when creating a "select options" field in Webform (like list of countries, state, ...).

I didn't find an existing module that allows me to add such pre-build list to Webform.

So, first I added my external database information to the setting.php file.

To test it, I build a simple php page containing this:

db_set_active('external_db');
$query = db_query("SELECT id, name FROM TABLE")->fetchAllKeyed();
db_set_active();
Print_r($query);

And, it's working (= I got a correct result of my request).

So then I added this to my .module file:

function webform_pre_build_list_db_webform_select_options_info() {
    $items = array();
    $items['modeles_db'] = array(
        'title' => t('Modeles_db'),
        'options callback' => 'webform_pre_build_list_db'
    );

   return $items;
}

function webform_pre_build_list_db() {

db_set_active('external_db');

return db_query('SELECT id, name FROM table')->fetchAllKeyed();

db_set_active('default');

}

And, it's not working (= my list is empty).

If I try with a request to the Drupal DB, then, it's working. For example:

function webform_pre_build_list_db() {
return db_query('SELECT cid, recipients FROM contact')->fetchAllKeyed();
}

Is working well, I got recipients form drupal table "contact" in my list...

What am I missing?

Any help will be appreciated!


texts: Should scripts/*.sh files be executable?

texts: Drupal 7's recommended file permissions don't allow it's /scripts/*.sh files to execute. Should any server user have the ability to run those?


texts: How to override a block generated by a module?

texts:
The PCP module has a pcp-block.tpl.php file in it's module directory that generates a block output.
To change that output I read that I could just copy this file into the "templates" folder of my current theme and it would take precedence over the one in the module directory. But it's not working. I did clear the theme registry cache.
How do I get it to work?


texts:
I am hoping that someone could assist me with a Pressflow problem on here as i cant find anywhere at all to discuss Pressflow. I have just updated my site to the latest version of Pressflow which was updated with the recent Drupal update. I uploaded all the files and now i can only access the frontpage of my site.

http://onlinebanter.com

If you try to click any links it just displays the front page. Would it be something to do with the htaccess file possibly?

All help appreciated as my site is effectively down with this problem and i dont know where to turn nor have the technical know how.

Thanks


texts: Insert values into custom field's extra columns in database

texts:
I'm new to drupal 7.

I've create a custom field with extra columns via field api, and create the field well(via UI), but I can't "save" it while using the field.

I've google for it and found some keywords like

hook_field_storage_write()、hook_field_attach_submit()

But still can't get what I want.
Can someone give me advices?


texts: Is using a TLS/SSL termination reverse proxy currently possible in Drupal 8

texts:
I use Nginx (port 443) which terminates TLS/SSL then forwards the request to Varnish (port 80) and on to Apache (port 8080). This worked really well for D7.

Am I correct in thinking that because of the following bug this set-up cannot work without 'Mixed Content' errors due to CSS and JS being written as absolute paths rather than relative paths?

References to CSS, JS, and similar files should be relative to server: less bytes, avoids mixed content warnings

I am looking for conformation of this question to ensure that it is not my server configuration at fault.


texts: How to display a custom block in a view twig file?

texts:
I added a custom block in the header of a view, and I am trying to get it to display. The block contains social media icons and links.
If I want to add a custom text area, I can use this code -
{{ view.header.area.options.content.value }}
In my kint I see this for the block I added -
      "header" => array:3 [▼
          "entity_block" => array:12 [▼
            "id" => "entity_block"
            "table" => "views"
            "field" => "entity_block"
            "relationship" => "none"
            "group_type" => "group"
            "admin_label" => ""
            "empty" => true
            "tokenize" => false
            "target" => "socialicons"
            "view_mode" => "default"
            "bypass_access" => false
            "plugin_id" => "entity"
          ]

So I tried to do  {{ view.header.entity_block }} but I get an error -
Exception: Object of type Drupal\views\Plugin\views\area\Entity cannot be printed. in Drupal\Core\Template\TwigExtension->escapeFilter() (line 425 of core/lib/Drupal/Core/Template/TwigExtension.php).
What can I do to display the block?


texts:
I've got a content type with fields:
starting date: Date (Unix timestamp)
duration: integer
ending date: Date (Unix timestamp)

User is setting only starting date (year, month, day) and duration (in days)
end after saving the content I would like to automatically calculate ending date (=starting date + duration)

I suppose I should use rules. I tried using actions like set value or calculate value but I failed. Could you help me?


texts: How to change the entity_type.manager so that it uses another database for entity storage

texts:
Using the following codes we can change the connection to an external database.

$database = Database::getConnection('', $database_key);    //'external'
$container = \Drupal::getContainer();
$container->set('database', $database);

However, when we want to save an entity we need to either use Node:: create or the entityTypeManager's create method as follows.

$node = \Drupal::entityTypeManager()->getStorage('node')->create( array(

        'type' => 'article',

        'title' =>'test',

        'body' => array(

            'value' =>'The body of the content',

            'format' => 'full_html',
        )
    );
$node->save();

As far as the entityTypeManager object is already initialized changing the database connection has no effects and the node will be saved in the default database again. So, is there a way to reinitialize the entityTypeManager or to reset the storage method so that it uses the second database?

Any helps will be appreciated.
Thanks


texts: How to create charts in Drupal while working offline that integrate with the Quiz module?

texts:
I'm now working on a local offline network website, which needs a graphical chart report for their quiz. But since it's offline I cannot use the (interactive) Google Charts API as a charting engine.

I tried FusionCharts already for the Webform Report module, but it has no integration with Quiz.

Any suggestions would be great.


texts: Installing a New Site with Drush and Ansible

texts:
I'm trying to create an Ansible Role to run on a VM that creates a new site (so my colleagues don't have to memorize the drush si --db-url command and automate the entire process.

I'm running into a problem where the drush si command is getting the error: Command site-install needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.  We know this means that we're trying to run Drush from a non-drupal environment, so even when I add the 'chdir' arg to my playbook, it still gets this error.

The command in the playbook looks like this:

- name: Site Install with Drush
  command: |
    drush si standard --db-url=mysql://{{ mysql_username }}:{{ mysql_password }}@127.0.0.1:3306/{{ mysql_dbname }} --sites-subdir="domain.edu.{{ drupal_uri }}" --db-prefix="d_"
    chdir=/vagrant/d7core/


texts: How to detect if "Show end date" is checked?

texts:
Trying to find a way to get the value of the checkbox "Show end date" on a date field on drupal 7.

Is it stored somewhere in the database? Can't find it.
Its definitely not in the $node object.

Any ideas?


texts: Change function view_unformatted to work with format HTML list

texts:
I have function in template.php which check if image fields exists (has content) and it adds classes if image exists (has_field) and if image does not exist (has_no_field).

This function now works with Unformatted format, but I need it to work with HTML list format. I already tried it with function theme_views_pre_render(&$view) but could not get it to work.

function theme_preprocess_views_view_unformatted(&$vars) {
  $view = $vars['view'];
  $rows = $vars['rows'];

  foreach ($vars['view']->result as $id => $row) {

    if (!empty($row->field_field_image) || !empty($row->field_field_image_2) || !empty($row->field_field_image_3)) {
      $vars['classes_array'][$id] .= ' has_field';
    }
    else {
      $vars['classes_array'][$id] .= ' has_no_field';
    }
  }

}

How to make this work with HTML list format?


texts:
I have a huge hierarchical vocabulary of terms and adding a new child to a specific term can be hard using the default multi-value select list widget.

Can I use an autocomplete widget or -better- an entity browser instead?


texts:
I would like to have the total sum of a number field in a report created with Webform Report.

How can I get the total sum of that column table?


texts:
I need to make a page with the list of the roles (I have 10 roles in the site) and the possibilities of changing their name,I tried to use views but was not possible.
I want something like the drupal's role page, but just with the modify button.
Some ideas?


texts: How to add link to my module in the Structure admin page

texts:
I would like to add a link to my module in the Structure admin page.

I already use a hook_menu for turn in my module accessible but how can I add a link in the "structure" admin section ?

function tamtamimporter_modules_menu() {
$items['admin/config/tamtamimporter'] = array(
        'title' => 'Gestion du Tamtam importer',
        'description' => 'Gestion de l\'importation des flux par le biais du module Tamtam importer',
        'page callback' => 'tamtamimporter_modules_page',
        'page arguments' => array('tamtamimporter_modules_page'),
        'access arguments' => array('administer site configuration'),
        'file' => 'tamtamimporter_modules.admin_list.inc',
        'type' => MENU_NORMAL_ITEM,
);
}

Thank you very much for you help.


texts: Webfm and views; can I create a view that has a list of links to the files?

texts:
Really new to Drupal and getting a little lost on this one. I want to create a view of files that are listed in webfm. These files will all be pdfs. Is this even possible.

My aim is to use standard drupal 6 modules to allow the users to upload reports in pdf and list them in a view. But the view needs to link directly to the file.
Another option is to use nodes to display pdf files. But this has to be in a way that end users can easily upload and create a node that displays the pdf.

Any help much appreciated.


texts: Breadcrumbs not showing parent, just Home > [insertPageNameHere]

texts:
[insertPageNameHere] is just a placeholder. It displays things like

  Home > About

and

  Home > News

and

  Home > How to carve wood

But not

  Home > News > How to carve wood

which is what I want it to display as that's how you navigate to the page "How to carve wood".

I've been googling this for the better part of today and I've tried several different modules, but I've come to realize that there's probably a fundamental flaw in how I use Drupal in general.
When I check the "Provide menu link" in a "News" content type page I get the desired behavior from the breadcrumbs, but then additionally my navigation bar gets a dropdown when I hover "News", and in that dropdown is every single page of the "News" content type.

I don't know what to do or what is wrong, but it's probably something about the arrangement of my site. Perhaps there are some fundemental breadcrumb/organizing principles I've missed?


texts:
I am very new to Drupal so please excuse me if this is an easily answered question.

Basically I wish to install CKEditor, however when I upload the module thorugh the online installer I am greeted with:

ckeditor_4.4.5_full.zip does not contain any .info files.

On trying to install from the URL another error:

The specified file temporary://files2sU5P could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
http://ftp.drupal.org/files/projects/ckeditor-7.x-1.15.zip could not be saved to temporary://update-cache-ac727b57/ckeditor-7.x-1.15.zip.
Unable to retrieve Drupal project from http://ftp.drupal.org/files/projects/ckeditor-7.x-1.15.zip.

When I attempt to install a different module (weather module) to test to see if it is the module itself, again an ulgy:

weather-7.x-2.6.zip does not contain any .info files.

Finally, on an attempt to place the extracted .zip file on the webserver in the /sites/all/modules directory, nothing shows up, I only see the 'Core' modules listed.

Any suggestion as to what I should do? Any help greatly appreciated,
- Dylan.


texts: Can't restore profile-installed site after D7.12 core upgrade

texts:
I have just attempted to do another minor core upgrade from 7.9 to 7.12. While the former went rather smooth, the latter is giving me a headache. I constantly get fatal errors like these below:

Notice: Undefined index: schema_fields_sql in /includes/entity.inc on line 265

Catchable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in /includes/entity.inc on line 284 and defined in /includes/database/select.inc on line 1300

I am now in the middle of yet another attempt to restore the site

The difference in that website, compared to that which successfully passed the core upgrade, is that this was originally installed using commerce kickstart profile. And my questions are:

Has anyone successfully performed core upgrade within a
profile-originated site?
What are safety rules to observe when doing
such upgrades (apart from obvious backing up the files and
database?)?
What approach you prefer for upgrading live sites? Do you usually create a new directory, which you test, and when ready, you redirect root catalog to that directory?

I hope your insights will bring back my confidence as per having chosen Drupal for commercial sites.


texts: I have a drupal site. The node revision is about 3.1gb in size. My hosting company will not allow me to login to the drupal site. I only have access to my phpadmin. If I empty the node revision table. Can I force a new revision node?


texts: How to translate custom fields in taxonomy terms?

texts:
I would like to have custom fields with translatable content in taxonomy terms. Is this possible with existing modules?

I know that this is possible if I use nodes instead of taxonomy terms: I can make fields translatable using the entity translation module and edit the different versions of the field by switching the language on the node edit page.

I am also aware that the taxonomy translation module allows to "localize" a vocabulary in the sense that its terms can have a different name and description for each language. I want not only name and description to be localizable but also custom fields that I have attached to the vocabulary, in particular text and image fields. Is this possible with existing modules?


texts: Message (from message stack) not translated into the preferred language of the recipient

texts:
Here is a code which can be pasted into devel/php (run php code) if the message template new_user_register exists with a user reference field called field_user_reference

This message should be sent when a new user register himself (But this has no link with my problem as the code can be run outside... I provide this information just to give some context)

$id=127;
$account=\Drupal\user\Entity\User::load($id);
$message=\Drupal\message\Entity\Message::create([
    'template' => 'new_user_register',
    'uid' => $id
]);
$message->set('field_user_reference', $account);
$message->save();

$subscribers = \Drupal::service('message_subscribe.subscribers');
$notify_options = [];
$subscribe_options = [
    'notify message owner' => TRUE,
    'notify blocked users'=>TRUE, //new user is blocked
    'entity access'=>FALSE, //new user don't have access (blocked)
    'uids' => [new \Drupal\message_subscribe\Subscribers\DeliveryCandidate(['subscribe_user'], ['email'], $id)],
];

$subscribers->sendMessage($account, $message,$notify_options,$subscribe_options);

Even if the template is translated, the user 127 will not receive the message in his preferred language but in the site default language.

Is it a bug or am I missing something?


texts: How to use ConfirmFormBase to confirm the action of another form?

texts:
I have a form that allows users to upload a CSV file. Upon submit, I would like to show a confirmation form ("Are you sure you want to import this file?").

However, the Drupal 8 examples for ConfirmFormBase seem to only focus on building the confirmation form without actually showing how one gets to that form from another form.

Can someone provide an example of a regular form that then works in conjunction with a confirmation form?


texts: Context Module Rehashing Blocks Slows Website on Development

texts:
So I'm working on a big website that runs fine on live (A bit on the slow side, but not unbearable), but when it comes to development servers it runs like ass (30 seconds to load a page ass). I used xdebug to profile the code, and what I found was that about half of the time in execution is spent updating the database. More specifically, on every page load when the Context module would load the the block list, it would look for block info in the cache, find nothing and then go and call _block_rehash, which then does DB updates for what appears to be every block. I tracked it down to where the context module tries to get a cache with

$cache = get_cache('context', 'cache');

And it comes back empty. I have caching enabled, block caching enabled, and I'm not sure why this is happening. Can anybody shed some light on this issue? This is an installation of Drupal 7 and Context 7-3.1


texts:
I'm trying to understand how arguments get passed into a view.

I have a view which was working using
content: type (=PersonStory) which is a join table
connecting via Views Relationships to
content: type (=Person)
content: type (=Story)

Here is the old view.

I have installed Panelizer and have a default page for content: type (=Person). When an author's page is loaded, I want to load a view of stories which they have written.

As you can see from the preview, the NID finds the correct author's name, but none of that author's stories are showing. The NID comes from content: type (=Person) and not from the base table in the view content: type (=PersonStory).

Current view:


texts: Form redirect in hook alter submit is not working in Drupal 8

texts:
I want to create multi step form based on tabs created using Fieldgroups. I have been able to alter the ECK form as well as added my own custom submit handler.

In the custom submit handler, I have added a form redirect that redirects to the same form but with a fragment so that the next tab gets shown. I am able to generate the fragment for the route, but its not working. In-fact, the redirect seems to not work at all for any valid internal route. Kindly advise.

Please find the form redirect url.

$url = new Drupal\Core\Url('eck.entity.add'
, ['eck_entity_type' => 'registration_configuration' , 'eck_entity_bundle' => 'config_2']
, ['fragment' => 'edit-group-add']);
$form_state->setRedirectUrl($url);


texts: How to render a Views Content Pane programmatically?

texts:
I have a view which displays all content of type "news" which is tagged with a specific tag, e.g. "world" (passed as parameter to the view).

The view machine name is news. It has a display of type Content Pane (machine name panel_pane_1). It also has a contextual filter set to "field_tags".

How to render this view content pane programmatically, passing tag value "world" to it?

(I've found ctools_content_render but no idea if this is the right function for this task and how to use it)


texts:
I know about using LANGUAGE_NONE instead of 'und' for an undefined language.  Is there also a symbolic variable for a 'Delete' operation?  In my hook_node_validate, I look at the value of $node->op, which is the operation.  I test it for the value of 'Delete', if the content is being deleted.

Should I be using something other than the string 'Delete'?  I looked in bootstrap.inc, but didn't find anything there.


texts: Need tags to update taxonomy list terms automatically?

texts: I'm not sure how this should work but I have a view that spits out taxonomy terms. I would like to create an article and add tags to the article that will update the taxonomy terms. I was also thinking it would make sense to update the path so the terms links to the article. Is this possible or how is this done? I have already created a tags field on my custom data type.


texts: Add query condition for referenced user by user ID

texts:
I have created a content type with machine name user_points and let's say have the following fields for this content type:

nid,
title,
reference_id (text),
user (reference of user entity),
points (integer)

the following code give me the sum of all points.

$storage = $this->entityTypeManager()->getStorage('node');
    $total_points = $storage->getAggregateQuery()
      ->condition('status', 1)
      ->aggregate('points', 'SUM')
      ->condition('type', 'user_points')
      ->execute();

I would like to add a condition to get total points for specific referenced user by user ID. How can I do it?


texts:
Since otherwise great spam module does not check user signatures for spam, I have hard times fighting spammers who just put their spam links in their signatures in the forum so basically they rendered my custom spam filters useless.

I appreciate if you have some suggestions to resolve this problem.


texts: how to get the size and last modified date of file with fid

texts:
Hi I have the filename and fid of the uploaded file in a media entity, how can I programatically get the size and last uploaded date in my module?  This is with D8
thanks


texts:
I am running Drupal 6 and have attempted to update the Core about 5 times recently, and it continues to tell me I haven't updated it. I AM running update.php, and doing it the way it's always worked before. But Drupal is not perceiving that I've done it.

No problems with individual modules updates. Drupal and following a procedure I've followed numerous times before, successfully. Not using Drush, but am using command line.


texts: Is it possible to export only specific content types?

texts:
While I was working on the theme update on my test server, original website got quite a lot of updates. But I can't just re-import the whole database, since I've got some new blocks and views here now. Can I somehow export only specific content types and import only them?

Any handy feature in Drupal itself, or maybe module? It should be a wide-spread requirement, since Drupal is such content oriented.


texts: How do I show a percentage value in a views_field?

texts:
How do I show the percentage value in a views_field?

col(1) (group by) field_a
col(2) (count)field_a *100/number of results " -->@total"

I'm still not able to use @total in a computed_field or a math-expression_field or a global_custom_field.

I need this value for the Highcharts module, so using "aggregation plus" also seems not the solution.

Using a PHP field inside views is highly risky for security reasons as I read here in other answers.


texts: Another question on Drupal files folder permissions and security

texts:
So there are the following two posts (among others) that say 755 is okay for the sites/default/files directory:

What are the recommended directory permissions?
Confusion about files permission

I took over a site that was hacked (due to missing a security update and improper Drupal/server configurations), whereby the hacker setup a generic form to download files (.js, .php, etc.) to the default files folder, then presumably they'd be able to execute them by setting up another page on the site that actually loads the file.

They did this by commandeering a site with admin privileges. And while I could not find an actual file they downloaded to the files directory, they did wind up altering the company's homepage with a "You've been hacked" message and an image of a country's flag.

Now to my questions:

Why have 755 on sites/default/files directory (and sub-directories) instead of 744? Isn't the files folder by definition for user files and system caching files? To flip the question around, is there any legitimate reason to allow "x" for the group/other users?
Is the new default .htaccess file (shown below for reference) that gets written to sites/default/files "secure enough" that even if a user hacks the front end or database, they can't really cause much havoc? If not, is there something that can be done to prevent all executables from running within /sites/default/files?

Here's the .htaccess file written by Drupal:

# Turn off all options we don't need.
Options None
Options +FollowSymLinks
# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>
# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
php_flag engine off
</IfModule>


texts: stylesheets-remove in .info.yml file doesn't work

texts:
I'm following Drupal 8 Theming Fundamentals, Part 1 to create a Drupal 8 theme. They say that default CSS styles are added by modules in the core as shown in the following screenshot.

Those CSS files can be removed from the .info.yml theme file using code similar to the following one.

stylesheets-remove:
  - core/assets/vendor/normalize-css/normalize.css
  - core/modules/system/css/system.module.css
  - core/modules/system/css/system.theme.css
  - core/modules/views/css/views.module.css

I've done that, but nothing happens (it's says the same). Plus, when I watch to the source of the page, I see the following.

The CSS styles are aggregrated. What is happening here? How can I fix this?


texts: When creating new content types, I know I can have an image field, but how do I associate a URL with an image so that when you click on the image, it goes to that node or location? Is the only way to get into the code and surround the img tag with an href tag?


texts: How to disable htmlspecialchars in custom module form table?

texts:
I'm making a table form

$form['table'] = [
  '#type' => 'tableselect',
  '#header' => $header,
  '#options' => $this->getOutput(),
  '#empty' => t('No vehicles found'),
];

In getOutput() I have 'vehicleName' =>  "vehicleId . "\">"  . $vehicle->vehicleName . "", for one of the fields. And it doesn't print out as normal html. It goes through htmlspecialchars() and I don't have clickable link at the end. How can I disable this?


texts: I would like to have different field widgets for distinct forms. Is there a way to define multiple widget types for a single field? Here's my case: on the create content form, the widget for the field "Tags", which is a term reference field, is an autocomplete term; but on another form that uses that same field, I would like to use a select list for the widget.


texts: Cannot figure out role-based pricing rule for custom Product Display/Variation in Commerce Kickstart

texts:
After working thru the Commerce tutorial and understanding roles, I thought it would be straightforward to set up a pricing rule based on user role, but I cannot seem to build the correct "Action" in Rules.

I want to reference a "Dealer Price" field in a Product Variation is the User Role = "dealer"

Error: Data selector commerce-line-item:commerce-product:field-dealer-price:amount for parameter amount is invalid.

Here are the steps I took to get to my current spot:

In a custom Product Variation "Bikes", I created a new field "Dealer Price" that mirrors the "Price" field that is already part of Commerce Kickstart
Dealer price
Field Type: Price
Widget: Price with Currency
2, Created role "Dealer"
Initiated creation of pricing rule
Store Settings >> Pricing Rules
Add Pricing Rule
Add Event: Calculating the sell price of a product
Add Conditions: 1. User has role(s): Parameter: User: [site:current-user], Roles: dealer; 2. Entity has field: Parameter: Entity: [commerce-line-item], Field: commerce_product; 3. Entity has field: Parameter: Entity: [commerce-line-item], Field: field_dealer_price
Then, I get stuck with Add Actions:
Select action to add: Commerce Line Item: Set item to specific amount
Line Item: Data Selector: commerce_line_item (Already inserted)
Amount: [Click on Switch to Data Selector]: commerce-line-item:commerce-product:field-dealer-price:amount
or commerce-line-item:commerce-product:field_dealer_price:amount or commerce-line-item:commerce-product:field-dealer_price:amount

I get an error msg when trying to reference the new price field "Dealer Price".

I feel like I am missing a connection within Commerce that ties the Product Variation to the commerce_line_item, but I haven't been able to identify the missing link. My products show up correctly in the shopping cart, so that hasn't been an issue.

Any help in tying the concepts of "Roles", "Rules", and "Commerce Kickstart" together is appreciated.

Thanks,


texts: Inject a custom menu to the Administration menu

texts:
In Drupal 8 I would like to inject a menu at the first position of the Administration menu
So that an editor can create a navigational structure for all users.
So I would create a "Custom Admin Menu"
Give the access to edit it
And it would be injected at the first position of the administration menu.
I don't want the editor to access the Administration menu


texts: What is the purpose of the entity_metadata_wrapper() function, and why should I use it?

texts:
I seem to be developing add-ons to a lot of modules that use Entity API at the moment, and the entity_metadata_wrapper() function keeps on popping up.

The docs page says this about it:

  Returns a property wrapper for the given data.

  If an entity is wrapped, the wrapper can be used to retrieve further wrappers for the entitity properties.

Ignoring the wonderfully Freudian spelling of the word 'entity' in there, I don't really understand what the purpose of these wrappers is.

I understand that the function essentially returns a EntityDrupalWrapper class:

  The wrapper eases applying getter and setter callbacks of entity properties

But what I can't understand is how it makes things easier.

For example, to update the status property of a node I could use this code:

$node = node_load($nid);
$node->status = 1;
node_save($node);

That's pretty clean. As I understand it (but may be wrong) the equivalent code using entity_metadata_wrapper() would be more verbose than that.

I'm not sure if it's simply the use of the term 'wrapper' that's tripping me up here, but I've looked through the code in the Entity module too and I'm not really any closer to understanding it.

Is anyone able to explain what the benefits of using this function are, and perhaps provide a simple code example for a common use-case?


texts: How can I programatically use the 'title' module to replace taxonomy title/description with fields?

texts: I have a custom module which creates a taxonomy vocabulary and installs terms using  hook_install, is there a way that I can programatically replace the title and description properties with fields using the title module programatically during the installation process.


texts: Is it possible to add second horizontal Menu below Main Menu?

texts:
I use "user menu" on top, for user related links.
I use "main menu", in reaching my main contents of site.

I need one more horizontal menu below the "main menu".
So second priority links will be there.
Can it be possible?

(I'm not interested with drop down menus. "Main Menu" and "Second Horizontal Menu" will be independent of each other)

Thank you very much for your help.


texts: Flush cache in case of WSOD without Drush on shared host

texts:
I have installed Drupal from using build-in scripts on runcloud.io, but I have noticed that Drush is not available. They have replied:

  Sorry, it is not possible to install drush into Runcloud. Because the
  installation leads to php crash as it will erase cerain php modules

I get used to using Drush, especially when Drupal 8 website encountered an unexpected error, without this option I don't see the way how to clear the cache without UI, restore from backup etc.

Are there any other options to rebuild caches without Drush to recover the website from an unexpected error?


texts: Will painless upgrading from Drupal 8 alpha 3.x to beta be possible?

texts:
I'd like to create a website with Drupal 8 Alpha 3. But I'd like to know for sure if it's possible to do a harmless upgrade to Drupal 8 Beta once that it's released.

I heard something about the Drupal 8 API being frozen, but after reading this article (http://buytaert.net/drupal-8-apis-are-freezing-but-not-frozen) i'm not so sure anymore.

Can anyone help out?

PS: The website i'm going to build is fairly simple (few content-types, views, blocks etc)


texts: appened custom text to content in template_preprocess_taxonomy_term drupal 8

texts:
I want to append some custom text to taxonomy term pages using template_preprocess_taxonomy_term hook, But when I add my custom array key to it, the text don't show up on the term pages.
PS I have cleared drupal cache many time.

Here is my code

function cars_theme_preprocess_taxonomy_term(&$variables) {
      if($variables['view_mode'] == 'full'){
         $variables['content']['cars_view'] = "this is test";
     }
}


texts: Apply custom date formats to reporting for specific webforms and fields

texts:
I realize that similar questions have been asked multiple times, but find that either the answers aren't what I am looking for or the specifics of the question aren't the same.

I want to create a custom date format for two different date fields within a specific Webform (not globally). The first date field is the submission date and the second is a date of birth field that we added.

I have created the desired custom date formats in admin/config/regional/date-time/formats let's call them A and B. Then I created custom date types using those formats in admin/config/regional/date-time.

I cannot find where to apply date type "A" to submission dates for the webform and I cannot find where to apply date type "B" to my custom date of birth field within the webform.

Submission Date:

Format A: Y-m-d - H:i
This appears to be an internal field, as it doesn't show up in my list of webform fields. I checked form settings and in advanced form settings as well as in form components.

Date of Birth Date:

Format B: Y-m-d
This is a custom field. When I click "edit" for this field, I don't see where to specify how the date format will be recorded.

Furthermore, it isn't important to me how these dates look when viewed on the survey or on the screen but they need to be recorded so that they are in the downloaded data in the specified format.


texts: How can i display view specific content type based on dynamic term name in node page?

texts:
Hi i have a content type called "Resource" with 2 term reference fields, branches (A,B,C,D) other one is  resource category (rec cat 1,rec cat 2) ,and i have created view called branches list displayed all branches like below in one node page.

A
B
C
D

and i have created another view called resources list it contains info based on resource category term reference it's ok but i need to display this view items based dynamic branch term name in my node page like when i click A need to display related branch info in my node page.

Please Advice.


texts:
I need to change the color of a specific block in Drupal. But no matter what I try in CSS it does not work, I know the code is correct as I have tried it in a different scenario (in Codepen) and it works fine so it must be a Drupal setting of some sort?

I want to change the background color of the second "testimonial" block.

This works but not when I add it to my theme global css:

div.testimonials:last-of-type .cover-component-slide{
    border: 1px solid black;
}

Whatever I try with pseudo-classes either doesn't change anything or the background color of both blocks.


texts: How to modify display of image form metadata after upload on node edit form?

texts: After uploading an image, how do I hook in and change the display so that Title appears above Alternate text?


texts:
This works if you actually click the button:

$form['submit'] = array(
    '#type' => 'image_button',
    '#src' => drupal_get_path('module', 'contact_block') . '/images/send_button.png',
    '#ajax' => array(
        'callback' => 'contact_block_ajax',
        'method' => 'html',
        'event' => 'click',
        'wrapper' => 'content-block-content-main-form',
        'progress' => array(
            'type' => 'throbber',
            'message' => '',
            ),
        ),
);

If, however, someone presses enter on another field, then the form submits without ajax.  How do I do an ajax form submission?


texts: How to access the external database in drupal?

texts: I want to get the values of the current drupal database and the values from an external database in to a same template file. How can I achieve this


texts: How to edit how Commerce outputs the Billing and Shipping information in the checkout review table?

texts:
Drupal Commerce on the Review page of the checkout process (e.g. checkout/4/review) by default outputs billing and shipping information above each other in a table, with each line as a different <tr> row containing one table cell:

I'm trying to re-theme this such that it's responsive and has the two addresses side-by-side on wider breakpoints. I know how to code that HTML, my problem is, how to get my HTML into the Commerce page template?

There's no corresponding tpl file I can find anywhere in the Commerce module, and other answers linked below seem to confirm there isn't one
I can't find a corresponding View to edit
I've read theming checkout pages in Drupal commerce, where an answer suggests creating a file page--checkout--review.tpl.php - but no such file exists already, and I don't want to recreate the template from scratch and potentially miss some important subtlety from the logic of the original, I want to read, understand and then edit the original.
The answer to Customize drupal commerce checkout page doesn't offer the HTML control I need, likewise How to theme checkout completion page in Drupal Commerce. I know I can edit the form array using hooks, but I can't use hooks to make the fine adjustments to the HTML output that I need, removing them from the table to make them responsive.
I wrote the answer to Customize commerce cart form page, which uses a custom module to allow the table to be editted in Views - but this only works for the cart, not checkout

How can I edit (not re-write from scratch) the HTML of the checkout review table?


texts: Drupal 6: Feeds mapping node taxonomy term

texts:
I using feeds module for import data from xml to node.

I have XML:

<root>
<item>
<title>Example 1</title> <!-- map to node title-->
<body>Body of example 1</body> <!-- map to node title-->
<term_name>My_term</term_name>
<term_tid>15</term_tid>
</item>
</root>

SELECT tid, vid, name FROM term_data;
tid vid name
15  19  My_term

If I map <term_name> to my node taxonomy term (and term name exist) its working.
But If i map <term_tid> to my node taxonomy term (and term tid exist) it's NOT working. Why?

Thanks for helping


texts: Extract final value from nested field collection

texts:
I have a content type with a field collection. This field collection has, as fields, other field collections. It works well, it groups the content for a node perfectly, but when trying to extract the data programmatically, I cannot access the values introduced. How would be the method. I tried with this piece of code, but it throws an error. Also not sure if adequate to my case (nested field collections):

$node = node_load($node->nid);
$node_wrapper = entity_metadata_wrapper('node', $node);

foreach ($node_wrapper->field_rich_text_group as $field_collection_wrapper) {
            $field_collection = $field_collection_wrapper->value();
                print_r($field_collection);
}


texts: Adding a module dependency to a public project

texts:
I have a module on drupal.org that is currently just has a -dev branch.  The module feature detects for another module, and uses it if available.  Otherwise, it can safely ignore it.  In other words, it is not listed a dependency in the .info file.

A bug report came in, and it looks like I may need to make this a proper dependency.

Is there proper way to handle this situation which minimizes people breaking sites if they update?


texts: Change the number of returned results in a taxonomy item list?

texts: Clicking a taxonomy term in a Node leads to a URL like taxonomy/term/7 with a list of nodes with that taxonomy term. However, my Drupal installation is only showing 3 nodes/page in that list. Is there a way to customize the number of results the default taxonomy term search shows?


texts: "install module" link disappears from module section in "Drupal 7" for some reason.How can this link enable to install my new modules.


texts:
I realise that the title probably makes no sense - and that's because I'm finding it quite hard to explain this.  But I will try my best.

I have a block that is set to only display on these pages

explore/whats-on
explore/whats-on/*

However when I come to a URL such as

http://example.com/explore/whats-on/event-2

I don't get my block showing up on the right.

Not sure what I have to do in order to make this work.
I'm using the Block menu and setting "only set on these pages" in order to do this.

Thanks for any help.


texts: how to drupal_set_title for add node form D7 (form alter doesnt work)

texts:
drupal_set_title doesn't work in my case. well... it worked some time ago (i don't remember when it stopped working) but after installing couple (4-6) of modules it stopped working. where else i can override page-title? it really bugs when you see 'Create Add new order' instead of 'Order form'... so i can live with that but it BUGS me every time i go to that page....

function driver_mailer_form_alter(&$form, &$form_state, $form_id) {
global $user;
if (!empty($form['type']['#value']) && $form['type']['#value'] == 'order') {
drupal_set_title(t('Order form'));
}

one more thing, if i do code like this

function driver_mailer_form_alter(&$form, &$form_state, $form_id) {
global $user;
drupal_set_title(t('Order form'));
if (!empty($form['type']['#value']) && $form['type']['#value'] == 'order') {
}

it works but it changes page-titles to all my pages  (((

and if its possible i really don't want work with .tpl files (i don't know how to yet), but if thats the only way in my case please provide sort of short tutorial.

THANKS to everyone for help!!!!!

I did try to weight my module... made a file 'driver_mailer.install' and used this code:

<?php
/**
* Implements hook_install().
*/
function driver_mailer_install() {
db_update('system')
->fields(array('weight' => 100))
->condition('name', 'driver_mailer')
->execute();
}
?>

then i turned off my module, flush my caches, and turned my module back...
nothing changed... not working.))))


texts: Drupal Commerce: product deleted resurrect after a while

texts:
I have a Commerce Kickstart 2 installation.

This is really weird and I can't understand. I'm deleting a product in manage products page. I confirm the deletion, but after a while when I search for that product, it mysteriously resurrects and is displayed in the search in manage products page.

Anybody could help me? I don't even know where to start.


texts:
Below is the code I am trying to get implemented for a custom token module. The purpose of the token is to work in conjunction with the [field_display_name] token for the comment author's name for a recent comment block (created be Views). I am using tokens in the rewrite results option of (Author) User:link Field in the View. The plan was to add this new token to the comment tokens so that it would show up in the View field's rewrite results replacement patterns. The token replacement pattern would be [field_display_name][commenter-count], with the intended final output being one of the following options:

No additional commenters -> just the comment author's name i.e. "John Smith"
One additional commenter -> "John Smith & 1 other"
More than one additional commenter -> "John Smith & 2 others"

I have enabled the module, and I am not getting the new token showing up in the replacement pattern options. I'm not sure if this is a code issue or a Views settings issue. I am suspicious that the argument ($nid) for the commenter_count API function to perform the query is not being passed in from the current node. Any help would be appreciated.

Thank you in advance.

<?php
/**
* @file
* Extends the comment modules tokens to include a token (commenter-count).
* To be used in conjunction with the [comment:author] token.
*
* When Enabled this module creates a token that counts all commenters
* of a node and returns one of 4 possible strings:
*
*  Case 1 - No commenter   - returns False.
*  Case 2 - 1  commenter   - returns Null.
*  Case 3 - 2  commenters  - returns string: "and 1 other".
*  Case 4 - 2 commenters  - returns string: "and # others".
*/

/**
* Get number of commenters for a specific node.
*
* @param $nid
*  Node-id to count commenters for.
* @return $commenter_count result an integer, or FALSE on error.
*/
function commenter_count($nid) {
  if (isset($nid)) {
    // Retrieve the number of commenters for the current node-id.
    $results = db_query('SELECT COUNT(DISTINCT uid) FROM {comment} WHERE nid = :nid',  array(':nid'=> $nid))->fetchField();
    if ($results->uid < 1) {
      $commenter_count = '';
    }
    elseif ($results->uid == 1) {
      $commenter_count = t('& 1 other');
    }
    else {
      $commenter_count = t('& @num others', array('@num' => $results->uid));
    }
    return $commenter_count;
  }
  else {
    return FALSE;
  }
 }

/**
* Implements hook_token_info().
*/
function commentor_count_token_info() {
  $info['tokens']['comment']['commenter-count'] = array(
    'name' => t('Commenter count'),
    'description' => t('This token counts the number of commenters of a given node.')
  );
}

/**
* Implements hook_tokens().
*
*/
function commenter_count_tokens($type, $tokens, array $data = array(), array $options =      array()) {
  $url_options = array('absolute' => TRUE);
  if (isset($options['language'])) {
    $url_options['language'] = $options['language'];
    $language_code = $options['language']->language;
  }
  else {
    $language_code = NULL;
  }
  $sanitize = !empty($options['sanitize']);
  $replacements = array();
  if ($type == 'custom') {
    foreach ($tokens as $name => $original) {
      switch ($name){
        case 'commenter-count':
           $replacements[$original] = commenter_count($node->nid);
          break;
      }
    }
  }
  return $replacements;
}


texts:
On Drupal 8, I have this line inside my form (my_module/src/Form/MyCustomForm.php).

$users = db_query('SELECT * FROM {users}');

var_dump($users) shows an object (of my query) and not the list of all users.

object(Drupal\Core\Database\Statement)[322] public 'dbh' => object(Drupal\Core\Database\Driver\mysql\Connection)[20] protected 'needsCleanup' => boolean false protected 'target' => string 'default' (length=7) protected 'key' => string 'default' (length=7) protected 'logger' => null protected 'transactionLayers' => array (size=0) empty protected 'driverClasses' => array (size=0) empty protected 'statementClass' => string 'Drupal\Core\Database\Statement' (length=30) protected 'transactionSupport' => boolean true protected 'transactionalDDLSupport' => boolean false protected 'temporaryNameIndex' => int 0 protected 'connection' => object(PDO)[15] protected 'connectionOptions' => array (size=10) 'database' => string 'theming' (length=7) 'username' => string 'root' (length=4) 'password' => string 'private' (length=8) 'prefix' => array (size=1) ... 'host' => string 'localhost' (length=9) 'port' => string '3306' (length=4) 'namespace' => string 'Drupal\Core\Database\Driver\mysql' (length=33) 'driver' => string 'mysql' (length=5) 'pdo' => array (size=4) ... 'init_commands' => array (size=1) ... protected 'schema' => null protected 'prefixes' => array (size=1) 'default' => string '' (length=0) protected 'prefixSearch' => array (size=2) 0 => string '{' (length=1) 1 => string '}' (length=1) protected 'prefixReplace' => array (size=2) 0 => string '' (length=0) 1 => string '' (length=0) public '_serviceId' => string 'database' (length=8) public 'allowRowCount' => boolean false public 'queryString' => string 'SELECT * FROM users' (length=19)

Why?


texts: New measures to prevent spam in comments of nodes?

texts:
I have a website with a node and comments which are moderated. I have installed Cache module, Image captcha (light distorsion). There was no spam till a few months ago. I installed Honeypot module and the few messages (probably automated) stopped being entered into the moderation list.

This week the site suffered a massive amount of flood spam. This coincides with the attack which is explained in Drupal.org. Is it possible that the attackers have learned how to override Honeypot and Image Captcha countermeasures?

How can I improve the security so the spam is reduced? My client will not allow more than a very small human input to delete a few spam messages.


texts:
How to nest Field Collections in Drupal 8?

I have Field Collection installed and working fine. What I want to achieve is that for example, I'll have a box on the front end which may contain 6 tabs of content, or two boxes each containing 3 tabs.

First part is working: I have a 'tabs' Field Collection with which I can 'add another item' (tab).

For the second option I need a 'box' Field Collection that contains nothing but the 'tabs' Field Collection.


texts: in hook_preprocess_node, how to tell if node is being edited?

texts: In hook_preprocess_node (or other themable hook), what is the easiest way to tell if node is being edited? I would like to add some javascript only when viewing the node, not editing.


texts:
I have a page generated by a custom module that contains two sections:

Product info
Recently viewed products

The product info only changes when the product is updated.

Recently viewed products are unique to every visitor (data is stored in $_SESSION).

Each section has its own render array.

'productinfo' => [
    // ...
    '#cache' => [
        'tags' => ['product:1234']
    ]
],
'recentlyviewed' => [
    // ...
    '#lazy_builder' => array(
      // ....
    ),
    '#create_placeholder' => TRUE,
    '#cache' => [
        'max-age' => 0
    ]
]

The behaviour I expect is that the dynamic page cache can cache the productinfo section, but the recentlyviewed would never be cached. However, if a session has not yet been started (i.e. first page view), the entire html page is cached to the cache_render DB table, and cache_dynamic_page_cache is always empty.

The X-Drupal-Dynamic-Cache header is always set to UNCACHABLE.

How can I get the dynamic page cache to cache the product info section?


texts: How to customize the "Read more" link in D7?

texts:
By default, the "Read More" link wrapped in the tag <li>. How i can change this tag to <p>?

I tried to use hook theme_node_view_alter(&$build), but i couldn't find in $build required variables.


texts: How can i prevent form submission when a file is being removed or uploaded?

texts:
I have a node form for my custom content type. There is file field in that content type. And i want to prevent form submission when a file is being removed and uploaded.
Note: File removed and uploaded via ajax.
any help please


texts: How can I modify body class based on non-taxonomy node data?

texts:
I need to add a custom class to my html <body> tag when certain elements are present in content (namely, either a featured image or image gallery, both of which are added to content using Entity Reference fields in the site's main content types).

Currently I'm accomplishing this using the Context module and a taxonomy vocabulary.  (Condition: Taxonomy; Reaction: Theme HTML).  The workflow for content managers looks like this:

Add an image or gallery to a content item
Don't forget to attach the appropriate taxonomy term so the page lays out correctly.

Oddly enough, forgetting step 2 is a rampant problem.

Any suggestions on methods for eliminating step 2?  It seems like it ought to be possible to just test for the presence of a value in the appropriate fields and either automatically attach the taxonomy term, or skip the taxonomy term and trigger the theme HTML based on the data values themselves.

I should mention that the taxonomy vocabulary in question has NO purpose in my application other than applying the appropriate body class.

I'm open to using some other module to accomplish this.  (Rules?  Couldn't figure out how to make this work either).

(Drupal 7).


texts:
I have 2 Drupal7 application, both is having the same code. Both application is connecting to 1 database and 1 file storage which is a separate folder/directory. My problem is when I save/edit/delete something on the other application, the other application is not updated not unless I clear its cache.
What will I do in order for the updates to reflect immediately in both application without clearing the cache?


texts: How to use drupal_add_library with a module?

texts:
I'm new to Drupal and don't really understand how to set up drupal_add_library.

I've made a simple module that links out to a .js file. However, this .js file depends on a couple of generic functions. I've put this generic functions in a library and want to call them.

I've set up my code as such:

function products_preprocess_page(&$variables) {
  drupal_add_library($module, $name);
  drupal_add_js(drupal_get_path('module', 'products') . '/assets/myScript.js');
}

But am not sure what to put in $module and $name (I'm assuming name is the actual name of the .js you want to call from the library), or even if this is the right place to call it.

Can anyone point me in the right direction?


texts: Drupal 7 vbo, is there an option to input text to operations?

texts:
Im using VBO with drupal 7. If I have an action which creates a new node/update a new/create a comment etc. How can I manually type the title/body text or what ever it is I'm setting?

Thanks for any help.


texts: Is there any alternative for field collection translation with unlimited values?

texts:
I have a Field Collection with unlimited values and is translated under Synchronize translations. I'm getting error when trying to save the translation node. From research I got the information that FC with unlimited values has problem with translation.

Is there any alternative way to achieve this?


texts: Combine multiple Fivestar rating fields into an average

texts:
I'm building a rating site and using Views to display top rated (Fivestar + Voting-api) content -- but calculating what is top rated is where I'm lost now. Here's my View:

http://dl.dropbox.com/u/2188345/views-sorting.png

As you can see  I've got things nicely set up, they are sortable etc. but now I'd need to add a final column showing the average score of those three combined, per node. I first thought I'd achieve this easily by creating a views template, and it was ok partially, but sorting didn't work as one would expect (since values were summed on the fly, not before the actual sorting happens).

Is there some smart way to combine values of those three relations via Rewriting - or some other means?


texts:
This is a simple query

$sql = db_select('node','n');
$sql->fields('n', array('uid','title'));
$s = $sql->execute();

I need to check the uid of all records :

if('n.uid' !=1 ) { do some stuff}

Should I store query result into an array before the if condition ? If yes how to do it ?


texts: Allow different users to upload pdf to nodes privately

texts:
I am trying to build a question answer site in drupal 7. User with teacher role will create a question node, after that users with student role can upload answers in PDF. Different students can upload/attach their respective answers pdf for that question node.

Teacher after evaluating uploaded answer pdf will upload evaluated/corrected pdf for each student. Students can not view other students answers pdf or corrected pdf.

I am thinking to create a question content type and answer content type. Each answer will be linked to specific question node. Answer content type will have two file fields, one to upload answer pdf and another for corrected pdf.

Is my approach correct? Is there any better approach or any module which can help?


texts: Can I remove dependencies from dependencies via composer?

texts:
If for example I have a distribution like thunder installed but I don’t want to have certain modules required via composer. Is there a way I can overwrite the dependencies of the distribution via my own projects composer.json?

This for example would be my project composer.json:
https://github.com/BurdaMagazinOrg/thunder-project/blob/2.x/composer.json

This would be the distributions composer.json:
https://github.com/BurdaMagazinOrg/thunder-distribution/blob/8.x-2.x/composer.json

And I want to remove drupal/adsense. Is that even possible?


texts:
Im trying to create nodes from CSV also with image in one image field. I'm using Migrate modul in Drupal 8 and Migrate from CSV. Data to node works fine, image download and copy works fine but in node i dont have that image, the image has also record in database but isn't connected with the node. There is my code, does anyone knows where can be the problem? Thanks a lot for advices.
The image field is called - field_uvodni_obrazek
and im using last Drupal 8.4.2

product_data.YML - node import

 dependencies:
      module:
        - migrate_source_csv
    id: product_data
    migration_group: product_migration
    migration_tags:
      - product
      - node
    label: Profile
    source:
      plugin: csv
      # Full path to the file.
      path: 'C:\Users\Hans\Documents\import.csv'
      # Column delimiter. Comma (,) by default.
      delimiter: '|'
      # Field enclosure. Double quotation marks (") by default.
      enclosure: '"'
      # The number of rows at the beginning which are not data.
      header_row_count: 1
      keys:
        - id
      column_names:
        0:
          id: 'id'
        1:
          kod: 'Kod zbozi'
        2:
          title: 'Nazev produktu'
        3:
          refstruct: 'Referenční struktura'
        4:
          kategorie: 'Kategorie produktu'
        5:
          objednani: 'Objednaci název'
        6:
          obrazek: 'Obrazek'
        7:
          popis: 'Krátky popis'
        8:
          rozsireny_popis: 'Rozsireny popis produktu'
    process:
      title: title
      field_produktove_cislo: kod
      field_objednaci_nazev: objednani
      field_refstruct: refstruct
      body/value: rozsireny_popis
      body/summary: popis
      field_kategorie_produktu:
        -
          plugin: explode
          delimiter: '/'
          source: kategorie
      field_uvodni_obrazek/target_id:
            plugin: migration_lookup
            migration: product_image
            source: obrazek
            no_stub: true
      field_uvodni_obrazek/alt:
         plugin: default_value
         default_value: title
      field_uvodni_obrazek/title:
        plugin: default_value
        default_value: title
      uid:
          plugin: default_value
          default_value: 1
      langcode:
               plugin: default_value
               default_value: 'cs'
      type:
        plugin: default_value
        default_value: produkt

    destination:
      plugin: 'entity:node'
      default_bundle: produkt
    migration_dependencies:
      optional:
        - product_image

product_image.YML - image import

id: product_image
label: Import all product images.
migration_group: product_migration
migration_tags:
  - product
  - file
  - image
source:
  plugin: csv
  path: 'C:\Users\Hans\Documents\import.csv'
  delimiter: '|'
  enclosure: '"'
  header_row_count: 1
  keys:
    - id
  column_names:
    0:
      id: 'id'
    6:
      filename: 'obrazek'
  constants:
    file_source_uri: public://import
    file_dest_uri: 'public://produkty/uvodni'
process:
  file_source:
    -
      plugin: concat
      delimiter: /
      source:
        - constants/file_source_uri
        - filename
    -
      plugin: urlencode
  file_dest:
    -
      plugin: concat
      delimiter: /
      source:
        - constants/file_dest_uri
        - filename
    -
      plugin: urlencode
  uid:
        plugin: default_value
        default_value: 1
  uri:
    plugin: file_copy
    source:
      - '@file_source'
      - '@file_dest'
  filename: filename
destination:
  plugin: 'entity:file'


texts: Send personalized email to a particular role

texts:
I want to send a PERSONALIZED email to all users of a particular role on my site starting with for example: Hello [first_name] [surname],

I have tried using the Rules module but was not successful.

Please is there a way to use Rules module to achieve this or is there another way?

Thanks in anticipation.


texts:
Some users enter body copy and comments with the caps lock on. All uppercase is considered shouting and I would like to convert it to lowercase or "natural" with uppercase characters at the beginning of a sentence.

Any easy solutions?


texts: Add AJAX to view reference field (UPDATE)

texts:
i have a custom block with two field viewsreference(field_lg_cb_lista) and field view_mode(field_lg_modo_de_vista ). i want to update the field view_mode to display only the view modes aviable for the content type of the view. the field viewsreference has his own ajax callback to udpdate the presentations of the view. when inspect the form, i see the ajax default function of the field viewsreference under $form['field_lg_cb_lista']['widget'][0]['target_id']. also exist $form['field_lg_cb_lista']['widget'][0]['display_id'](field for presentation). i attach my callback to display_id and it work but
only work in backend when edit the block in front(layout builder modal) the field make nothing, i think is a problem when try to get the form value
here my code thanks for help
function la_gota_core_block_type_form_alter(array &$form, FormStateInterface &$form_state, string $block_type) {

  if ($block_type == 'lg_cb_lista_de_contenido') {

    if (empty($form_state->getValue('field_lg_cb_lista'))) {
      $default_value = "";
    }
    else {
      $f_value = $form_state->getValue('field_lg_cb_lista');
      $default_value = $f_value[0]['target_id'][0]['target_id'];

      if($f_value[0]['display_id'] == ""){
        $default_value = "";
      }
      dpm($f_value);
    }

    $form['field_lg_cb_lista']['widget'][0]['display_id']['#ajax'] = array(
        'callback' => 'formCallBack',
        'event' => 'change',
        'wrapper' => 'miid'
    );

    $form['field_lg_modo_de_vista']['#attributes']['id'] = 'miid';
    $form['field_lg_modo_de_vista']['widget']['#options'] = getViewModes($default_value);

    dpm($form);
  }

}

function formCallBack(array $form, FormStateInterface $form_state) {
  dpm($form_state->getValue('field_lg_cb_lista'));
  return $form['field_lg_modo_de_vista'];
}

function getViewModes($view_name){
    switch ($view_name) {
      case 'varbase_blog':
        $options =  \Drupal::service('entity_display.repository')->getViewModeOptionsByBundle('node', 'varbase_blog');
        break;

      case 'lg_vw_eventos':
       $options =  \Drupal::service('entity_display.repository')->getViewModeOptionsByBundle('node', 'event');
        break;

      case '':
      default:
        $options = ['' => '-Selecciones una presentacion-'];
        break;
    }
    return $options;
}


texts: Fields pending deletion error when disabling comment module

texts: I tried to disable the comment module but got the following error comment: Fields pending deletion. I deleted all my comment content and fields, but the error keeps appearing and I can't disable the module. Can anyone tell me what's happening?


texts: How do I add tabledrag with 'weight' to admin form

texts:
I have built a fairly basic module but i'm struggling with the UX of the admin form. Essentially I need a list of items that have several values; a textfield, checkbox, select list and a button to delete them.

I've built all of the functionality (including the "add one more" using the example in the drupal ajax examples module) and its working great, except now I need to be able to reorder the items and the webmin style up/down buttons are not good UX. I've been hacking to no avail at numerous examples like:
http://www.urbaninsight.com/2012/09/11/creating-table-with-draggable-weights-in-drupal-7

It doesn't appear that theme_hook_form is being called so I can't inject the weight javascript, styles or markup.

I added this to the .module file:

function module_cache_theme() {
  dpm("themehook");
  return array(
    'theme_module_settings_form' => array(
      'file' => 'module_form.inc',
      'arguments' => array('form' => NULL),
    ),
  );
}

The menu item is in the hook_menu:

  $items['admin/config/development/module'] = array(
    'title' => 'module',
    'description' =>'',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('module_settings_form'),
    'access arguments' => array('administer site configuration'),
    'file' => 'module_form.inc',
  );

When the cache is regenerated I get a dpm message but the method theme_module_settings_form is never being triggered.

Ideas?


texts:
In a multi user environment, how do I get a panel to display the node content form (to enter text) of a user knowing that each user has such a (separate) node. In other words, a visitor on Jack's panel page would be presented with Jack's form and be able to write something there, but if visiting John, he would be presented with John's form.

I tried the Form Block module but it shows the node of the viewing user, not the user being viewed, on all users' panel pages.  Is there a way for this to add an argument or contextual filter in panels so that each user's form displays appropriately?

I should add that the nodes are back linked (Entity Reference) to their users.

Any help would be greatly appreciated.
Thank you.
:)


texts: Modules needed to create the best WYSIWYG experience?

texts:
What do you use to give the end user (editor) the best WYSIWYG experience, considering the following requirements (besides basic input):

Insert images/flash and align then left/center/right with optional caption, choice of sizes
Easily upload files and add links to them
Add custom css classes to content
Add custom buttons that provide custom/special formatting
Be truly WYSIWYG, i.e. using styles/typography that the end user will see

From a developer/maintainers point of view:

Keep front-end theme styles in-sync with styles used in WYSIWYG editor

Thanks, Egil.


texts:
Is it possible to get page content (in array) from for example a Title. Like this;

$wantedPage = function_to_get_page_content('This is the title');

and then just print_r($wantedPage) to get this page content, in array.

I'm pretty new on this great CMS-system..


texts: Views exposed filter with selected tags/terms

texts: I am importing RSS content with Feeds Module that is tagged with the Atom standard category-tag. I would like to give the user the opportunity to filter the content in a view, but only by some selected tags (as the tags imported are too many and I am not able to assign them to different vocabularies). I tried to achieve it with grouping, but only received empty results. Is it possible to offer filters that only offer some selected tags?


texts: Display main menu for logged in users only

texts:
I'm new to drupal and using the latest version (7.x). I want hide the Main Menu in all pages until user log-in to the site. I set the Main Menu block role set to "Authenticated Users" only. But I can see the Main Menu on all pages as anonymous user.

How could I hide the Main Menu for anonymous user and show them once logged In ?


texts: How to import multiple images with Feeds importer from CSV?

texts: I am using feeds importer for importing images. I have mapped the column "Image" in my CSV to the "Image: URI (field_image:uri)" field in my importer configuration. It workds for now when I put only one image URL in the CSV file, but how to import multiple images?


texts: Output same content type in different format

texts: I need to output a same content type in 2 formats : html and xml. How can I do that and what url to use o access these different outputs?


texts: Views : List all user who didn't publish anything

texts:
Is it possible to create a list of all the user that didn't create a certain kind of content? I'm making a school graduated student album and each student have to creates a personnel node about there final projet and I need to verify who didn't create is node.

I try to create a list of all user of the student role but when I create a link whit the node with "Content authored" and I add the node Title the users without a Final Project Node hare removed from the list and this is excly the opposite that I need.

Thanks for you help.


texts: Why can html.twig files be placed outside the templates folder?

texts:
In Drupal theme folder structure, there is written:

Templates provide HTML markup and some presentation logic. Contrary to Drupal 7, in Drupal 8 template files (*.html.twig files) must be stored in the 'templates' subfolder.

In my theme, I have a styleguide folder at the root. Drupal 9 finds template files, such as mytheme/styleguide/components/10-atoms/form/input.html.twig, in this folder.
Drupal 9 will use this input.html.twig file despite it's not in the mytheme/templates folder.


texts: How do I allow access to my custom module to "anonymous user"

texts:
case :

I have created a custom module
Implemented a hook_menu() as shown

  function my_custom_menu() {

  $items = array();
  $items['my/custom/link'] = array(
    'title' => t('My Custom Form'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array('my_custom_user_form'),
    'access arguments' => array('access content'),
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM,
  );
    return $items;
}

But problem is that "anonymous users not able to access link"

Please guide me...


texts: Drupal Commerce causing database deadlocks

texts:
I'm trying to get to the bottom of a known Drupal Commerce bug to do with row locking.

When a user logs in on my development site, Drupal Commerce starts multiple identical queries that look like this, even when the cart is empty:

SELECT revision.order_number AS order_number, revision.revision_id AS revision_id, revision.revision_uid AS revision_uid, revision.mail AS mail, revision.status AS status, revision.log AS log, revision.revision_timestamp AS revision_timestamp, revision.revision_hostname AS revision_hostname, revision.data AS data, base.order_id AS order_id, base.type AS type, base.uid AS uid, base.created AS created, base.changed AS changed, base.hostname AS hostname
FROM
commerce_order base
INNER JOIN commerce_order_revision revision ON revision.revision_id = base.revision_id
WHERE  (base.order_id IN  (''203''))  FOR UPDATE

They're all started less than a second apart, and they all hang and sit waiting for a transaction lock to be granted. The thread I linked to suggests the problem could be the same user is logged in on different browsers, but there's only one entry in my sessions table, so I'm looking for another cause.

What else could is going on here? The big obvious clue I can see is that I can't seem to run that query without an error - "base.order_id IN (''203''))  FOR UPDATE" throws a syntax error, and as far as I can see that's not normal usage for IN - it's normally two integers seperated by a comma, like a limit query, like ('1','12'). The order itself is an empty cart: opening the blob file just gives me this:

<!DOCTYPE HTML><html lang='en' dir='ltr'><meta charset="utf-8" /><meta name="robots" content="noindex,nofollow" /><meta http-equiv="X-UA-Compatible" content="IE=Edge"><style>html{display: non

But I don't know enough about SQL to know if this is something you can do in a join somehow - what's really going on here? And where else should I be looking to debug it?

UPDATE 11/02: I haven't gotten to the root cause of this, but I've done some more investigating.

Channel Islander is right, there's nothing screwy with that syntax. I must have just changed it somehow between copy and pasting and trying to get the query to run.
I truncated the order and order_revisions table in the dev site, then tried to replicate the bug by adding and removing stuff from my admin user's cart (trying to create a lot of revisions). I couldn't replicate the bug like this, and performance got a lot better from them onwards: page loads when logging in and out sped up by multiple seconds, and I can't even catch this SELECT... FOR UPDATE query in phpMyAdmin's status tab.

This seems to have resolved the issue for now, but truncating both tables is obviously not feasible for a production site. Maybe setting orders at "cart" stage to expire after a certain time would be, though?


texts: drupal 7 wildcard and parameter replacement?

texts:
How can i use _load() function in drupal 7 ? Please look at this one.

function sample_menu() {
  $items['node/%hotel_node/images'] = array(
    'title' => 'Images',
    'weight' => -10,
    'page callback' => 'show_tab_page',
    'page arguments' => array(1, 'images'),
    'access callback' => TRUE,
    'access arguments' => array(1),
  );
  return $items;
}

function hotel_node_load($nid)  {
  //$node = node_load($nid);
  $node = node_load(array('nid' => $nid));
  return $node;
}

function show_tab_page($s1='',$s2='') {
  return('s1 is @s1 with $s1 @s2 with $s2',array('@s1' => $s1,'@s2' => $s2));
}

while trying in the url : http://localhost/drupal/user/2337/images

Am getting Page not found
The requested page "/drupal/node/232/images" could not be found.

Please help me out. thanks


texts: Display summary of entered field values and permit user to cancel submission

texts:
Versions:
   Drupal 7.12
   Webform Module 3.17

I have webform that has multiple pages (using pagebreaks). When the user completes the final page I would like to display a summary of the entered information so that the user can double check it before submitting it.

My first thought (after much searching) was to:

Use the hook_webform_submission_presave hook to catch the submission before it is saved
Display the field values
If the user decides not to submit the form cancel the submission

However I am having difficulties applying the above theory to reality.

Is this possible?
Is the above method the best approach (if it is, how do I achieve it)?
Or is there a easier/better way to achieve this?

Any help would be appreciated......Kevin


texts:
Hi, This my administration page for content view In drupal 7.31. Is there any module for inserting filter for this Custom columns(marked ares) in the top of That table view. I mean search with template id, language or channel

note: template id, language and channel these are my custom fields


texts: What's a good module for moderating content submissions?

texts:
Drupal 7.x. I'm looking for a module where it allows me to moderate any content submissions prior to them being published. For example:

I have writers, editors, and publishers groups. I want the writer to create the content, then the editors MUST look over the content to check for errors/mistypes, and THEN publishers take a last look and push the content to be published.

Is there a module that can handle this task for Drupal 7.x?


texts:
Is there any module that would give option to print order in commerce?

Im trying to create option to print orders for packaging department but can't find a way that would allow customer details and order line items.


texts: Something preventing redirect from being executed

texts:
I'm using d7.

I've a flag "I have a solution" attached to a "problem" content type
When an user flags it a rule is fired.

Actions are:
1 - create a new "solution" content, name it "justcreated-solution"
2 - save it
3 - add a list of variables to collect relations endopoints
4 - add the first "problem" endpoint
5 - add the seconf "solution" endpoint
6 - create the relation
7 - redirect to the [justcreated-solution:edit-url]

the bad thing is that redirect in 7 is NOT working!

if I add a 6.1 step that prints a system message with [justcreated-solution:edit-url], I realize the url is correct, nonetheless the redirect never happens

any suggestion?
many thanks in advance

Angelo

P.S: an absolute web address redirect (http://example.com/whatever) that works in another simple rule created for testing, in this rule doesn't work at all!


texts: Hello I Am Making A Website On Drupal And I Am Adding A YouTube Video On Some Page So I Want To Hide These Videos From Some Countries example I Want To In Usa So I Want to hide in india  So Which Module Or Way That I Can Do It


texts: "Uncaught TypeError: Cannot call method 'call' of undefined at 507 jquery.validate.js"

texts:
I am trying to implement clientside validation using the clientside validation model. I have been following the documentation located here. Specifically the Form API Section for Drupal 7. I believe I have followed the instructions faithfully but when I try it out I get the following error:

Uncaught TypeError: Cannot call method 'call' of undefined at 507 jquery.validate.js

Here is my slightly modified jquery script I am using:

(function ($) {
  //Define a Drupal behaviour with a custom name
  Drupal.behaviors.dynamicTextfieldValidator = {
    attach: function (context, settings) {
      //Add an eventlistener to the document reacting on the
      //'clientsideValidationAddCustomRules' event.
      $(document).bind('clientsideValidationAddCustomRules', function(event){
          //Add your custom method with the 'addMethod' function of jQuery.validator
          //http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage
          jQuery.validator.addMethod("validInputType", function(value, element, param) {
              return value !== '';
          }, jQuery.format('Field can not be empty'));
      });
    }
  }
})(jQuery);

The code looks right to me but I am no javascript expert. Any ideas what I could be doing wrong?

Thanks.


texts:
I added a edit link using hook_form_alter in my node form..When I clicked on this link it goes edit content page. But I need to open this form on popup and change the form value from here.

My question: How to open a node form in popup after click on edit from front end?


texts: How to avoid no-wrapper tags on regions?

texts:
How do I make sure ALL regions are wrapped according region.tpl.php?

In a subtheme of Zen I have created my own regions and modified the page.tpl.php file to something like the following:

<div #page>
    <?php print render($page['header']); ?>
    <?php print render($page['content']); ?>
    <?php print render($page['footer']); ?>
</div>

Some of the regions get a region wrapper from region.tpl.php, others get the code from no-wrapper.tpl.php (no wrapper). How can have all regions receive a wrapper?


texts: I want to change the layout of add/edit page

texts:
I have one content type called Restaurant, and I want to change the layout of this content type in the administrative area. When the administrator user adds/edits a Restaurant node, the layout should be my custom layout.

How can I change the whole layout?


texts: Modify Search Block HTML Output for Zurb Foundation Topbar

texts:
I have created a subtheme from the Zurb Foundation base theme for Drupal 7.

I am trying to:

Add "data-equalizer" and "data-equalizer-watch" to the html output of the core Search Form Block.
Change the Search button text to a glyph-icon
Add/Remove some classes from the Search Button
Change the column sizes

Unfortunately, it currently appears to look like this with a simple markup:

The current HTML output looks like this:

        Search
        <input title="Enter the terms you wish to search for." type="text" id="edit-search-block-form--2" name="search_block_form" value="" size="15" maxlength="128" class="form-text">

<button class="secondary button radius postfix expand form-submit" id="edit-submit--3" name="op" value="Search" type="submit">Search</button>

When building my own test form with HTML and CSS (for design purposes), I was able to achieve the desired look for my search in the topbar in a dropdown that appeared like this:

The code I used for that is here:

    <input type="text" name="search_block_form" placeholder="Search..." id="nav-input" class="postfix" data-equalizer-watch>

    <button name="op" id="nav-button" class="postfix"></button >

The current html output of the Drupal Search Block Form also adds the classes "secondary" and "radius" and I want to remove those.

I know what I want the html output to look like but am unsure as to how to make the output exactly what I want it to be.

I have looked online at several different theme hooks but none seem to do the trick and have limited to me.


texts:
On our system (D5) two nodes have been deleted (by mistake). I need them back but I can't simply load a backup as there's a lot of new content created.
I want to create these two new nodes again, manually, and they will obviously have a bigger nid.

Then, I would like to simply change the nid to the old (the deleted one) nid. This way, all node references will work again. (Node references from other content types).

I tried the following:

//load the newly created node
$node_new = node_load(1234580);

//put the
$node_new->nid = 81580; //this is the nid of the deleted node
$node_new->vid = 81580; //and its vid

node_save($node_new);

And if I print_r $node_new at the end, it says the nid is 81580, but on the database there's no node with that nide.

How can I create a node and specify the nid manually??


texts: How to you add a table of contents in a pdf for a book that is exported using views_pdf?

texts:
I am using the book module in Drupal 7 and have successfully exported the whole book as a pdf using views_pdf. However, I would like to add a table of contents on the first page to list all the node/page headers that are in the pdf. It would be nice if the table of contents could then link to each of the page titles in the pdf, but this is not absolutely necessary. Does anyone know how to do this?

I've looked at the code for views_pdf_template.php and think it can be modified to keep track of all the page headers and associated numbers, and then render it in the close() function. But I'm not sure if this is the right way to do it. Does anyone have any ideas? Or has done this before?

Thanks in advance.


texts: I updated views 3.0 to 3.7 and it broke a slideshow view that was setup with contextual filter to display certain content based off the url. Same setup just updated views if anyone can tell me why this does not work with the new views or how to make it work, would be most appreciated.


texts:
I´m trying to update a shipment cost for different zones of a country
(using predicates, conditional actions)

Using the trigger Getting shipping quote via Flat Rate
class uc_flatrate, activated , I´m trying to modify the rate..

Still the trigger doesn´t get called,
I tried to modify the objects with php , didn´t work ,
then i tried a simple test to display a message to the user, didn´t work..

then I tried to write a simple text into a file to see if the event gets called... didn´t work

How can I run a php script when I press calculate shipment cost? (or whenever the shipment cost is calculated) ?


texts: How to apply css to the maintenance page?

texts:
I need to work on some serious update to my D7 website. So I put my site in maintenance mode. I'm able to personalize the maintenance page by creating maintenance-page.tpl.php in my theme's template directory and it works like charm, no issues. The problem is, none of my theme css files are loaded when I'm opening the site in maintenance mode.

I'd really like to prettify the maintenance page for any visitors who visits the site in the mean time (while I'm updating). How do I do that? BTW, I'm using omega theme stable release.


texts: Where do I store classes and ids that the user inputs in my custom module?

texts:
I am creating a module that I would like to submit to the drupal.org repository. In the admin section of the module there are various input fields where the user is able to enter classes and ids for various elements that appear on specific nodes. It's basically a module that enables the user to do theming that would otherwise require custom code.

Since I'm not a Drupal rock-star in any way, and I have only worked in custom code and website specific modules, I have a very important question:

How do I store the classes/ids that the module's user will submit?

I guess that there are 3 options here:

Store the classes/ids in a module-specific table in the database
Store the classes/ids in the "Variable" table of the database
Store the classes/ids in a file, in the module's directory

I have some pros/cons in mind about each case (e.g. I don't like the idea that a theming element would be stored in the database) but I would like your input too: which one of the methods above is the best and drupal-friendly? If I missed an option, please feel free to list it.


texts:
I try to add some html in "secondary nav".

A little bit like that :

          MY CUSTOM HTML

First link

Second link

(my menu is not a block).

Do you know how can it be done? By template suggestion or a function for example?


texts: How to apply theme_menu_tree to only the top  menu

texts:
I am using the following function in the template.php (drupal 7) to override the original menu output. However, the  tags in all levels are also affected. I wonder how to only apply it to the top/first  tag? Please advise. Thanks!

function THEMENAME_menu_tree__MAIN_MENU($variables) {
  return '
' . $variables['tree'] . '
';
}


texts: How to display block with term image field when viewing term node

texts:
I'm using the default Taxonomy term view in drupal 7.
I have Vocabulary: Portfolio with terms: Wedding Photos, Kids Photos, Other Photos. And I want to show a block of the term image field when a specific term is visited.

similar to this ( Add taxonomy term image to a view )

But because there are many content types in the same category the block is showing many term image fields instead of just one.
I try different Contextual filters and Relationships and Query settings: Distinct. But no result so far.


texts: Can't save custom field data: form submit function doesn't fire

texts: I've added custom "markup" field to the commerce_product table, next I've implemented hook_form_FORM-ID_alter, but submit function doesn't executed.


texts:
I have a custom block created in code. I do not want to cache the block. I know I need to use BLOCK_NO_CACHE but I am not sure where to use it.

function mymod_block($op = 'list', $delta = 0)
{
    // set up an empty array which will contain the block contents
    $block = array();
    if ($op == "list") {
        // Generate listing of blocks from this module, for the admin/block page
        $block[0]["info"] = t('mymod');
    }
    else if ($op == 'view') {
        $block['content'] = "hello world";
    }
    // return the built content
    return $block;
}


texts: Menu is not creating in admin/settings page?

texts:
I am adding a custom module, and wants when someone install the module, menu will be added to add data in the admin/settings page...
But i am getting nothing:

Below is the code i wrote.. pricepackages is the module name i want to created

please help me ..

function pricepackages_menu()
{
    $items = array();
    $items[] = array(
        'path' => 'admin/settings/favorites/quotes',
        'title' => t('Manage Quotes'),
        //'page callback' => 'drupal_get_form',
        //'page arguments' => array('poke_test_form'),
        'callback' => 'drupal_get_form',
        'callback arguments' => 'pricepackages_settings',
        //'access callback' => 'poke_access_callback',
        'access' => user_access('Access administration pages'),
    );
}

Settings hook is like this:

function pricepackages_settings()
{
    //$form['#submit'][] = 'poke_test_submit';
    $form['quote_manage'] = array(
        '#title' => t('Select User'),
        '#type' => 'textfield',
    );
    return $form;
}


texts:
I am getting the following error.

  Recoverable fatal error: Argument 3 passed to
  Drupal\page_manager\Routing\VariantRouteFilter::__construct() must be
  an instance of Symfony\Component\HttpFoundation\RequestStack, none
  given, called in
  /home/ranjith/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php
  on line 266 and defined in
  Drupal\page_manager\Routing\VariantRouteFilter->__construct() (line 64
  of
  sites/all/modules/contrib/page_manager/src/Routing/VariantRouteFilter.php).

What does it mean? How can I fix that error?


texts: add CSS programmatically for a specific page in .theme file

texts:
I have a question about adding a CSS file programmatically depending on which site I visit. In Drupal 7 I could achieve this by calling the following line in the preprocess_html method in the template.php file:

function template_preprocess_html(&$vars) {

    $css_file_name = 'specific-page';
    drupal_add_css(path_to_theme() . '/css/pages/'.drupal_clean_css_identifier($css_file_name).'.css', array('group' => CSS_THEME));

}

But I can't achieve the same with Drupal 8. I tried the same like in 7 just with the new Drupal 8 way. So here are my tries in the template.theme file

use Drupal\Component\Utility\Html;

1.)

function template_page_alter(&$page) {

  $css_file_name = 'specific-page';
  $clean_alias = Html::cleanCssIdentifier($css_file_name);
  $path_to_css = drupal_get_path('theme', 'template') . '/css/pages/' . $clean_alias  . '.css';

  $page['#attached']['css'][] = $path_to_css;

}

2.)

    function template_preprocess_page(&$vars, $hook) {

      $css_file_name = 'specific-page';
      $clean_alias = Html::cleanCssIdentifier($css_file_name);
      $path_to_css = drupal_get_path('theme', 'template') . '/css/pages/' . $clean_alias  . '.css';

      $local_css = array(
        '#attached' => array(
          'css' => array(
            $path_to_css => array(
              'group' => CSS_THEME,
              'weight' => 9999),
          ),
        ),
      );

      drupal_render($local_css);

    }

Here I get the error: You are not allowed to use css in #attached

3.)

function template_page_alter(&$page) {

          $css_file_name = 'specific-page';
          $clean_alias = Html::cleanCssIdentifier($css_file_name);
          $path_to_css = drupal_get_path('theme', 'template') . '/css/pages/' . $clean_alias  . '.css';

          $vars['attached_css'] = array(
            '#attached' => array(
            'data' => $path_to_css,
            'options' => array(
             'group' => CSS_THEME
            ),
           ),
          );

}

In my template file:

{{  attached_css }}

None of my tries worked so far. I collect the information for the code from serveral tutorials and stackoverflow questions, but it looks like that many of them are very old comparing to the stable release date of Drupal 8. So maybe there are some changes which I forget.


texts: Can the reaction of "Cron Maintenance" in the Rules modules pull data from nodes?

texts:
Overall Goal: Have an email sent whenever a node has not been commented on for a certain amount of time (ex: 1 hour).

Previous Attempt: Have a node become stickied when a comment is posted.  Then unsticky the node after a certain amount of time.  If a node is not stickied, send an email.  This worked for one evaluation time rather than having evaluation over the life of the node.

How it could be done for continuous evaluations:
1. Use the same concept from previous attempt and have nodes stickied when commented on.
2. Have a Rule react on Cron Maintenance that will unsticky any nodes that have the newest comment older than a given time amount.
3. Then have another rule that runs on Cron Maintenance to send emails to a user that is specified within a node's field when said node is not sticky.

My main issue about this is that any Rule that is reacting on Cron Maintenance isn't letting me pull information from the node table.


texts: Ubercart trying to send email to blank email address

texts:
I have an issue with ubercart 2.10 on Drupal 6.26 (with node-checkout 6.2 beta8) which tries to send an email a blank email address every time you remove an item from the cart. The error message received is:

 Unable to send e-mail. Please contact the site administrator if the problem persists.

I have searched online for possible answers and have not found any. I have ensured that the store email address is set and it is and user's email is set (obviously as they wouldn't have an account on the system). All the online reports of being unable to send an email has to do when check-out is completed - NOT when removing items from the cart. This problem seems to be unique to me.

Why would ubercart try to send an email when removing an item from the cart to begin with? That doesn't make sense to me.

If anyone has experienced this problem before or has any idea what could be causing it then please enlighten me as I have been bang my head on this one for a week now.


texts:
I have the following error on my drupal Site, PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'filename' in 'field list': SELECT name, filename FROM {system} WHERE status = 1 AND bootstrap = 1 AND type = 'module' ORDER BY weight ASC, name ASC;

It all started when one of the users of the Server tried to remove mysql installation files. The database is working correctly however it does not show the column in the table that the previous query tries to fetch.

I have already tried both to update-db from drush or to update the whole installation with no success.

I need some help please, I have thought to alter the table to include those columns but I don't know if that's actually a good idea.

Thank you


texts: Using OG and FormBlock I want FormBlock content to default to current group

texts:
This question is somewhat similar to this one: Organic groups automatic audience selection - only I am using FormBlock module to create OG content from within the home page of the group.  I don't want the user to select which group they are posting into - I want it to default to the current group context.

Another layer of complexity is that I'm using QuickTabs - each tab has a different formblock.  So I am not making a call to the node/add form.  I simply want the current OG context to default as the new content's audience.

Anyone have any ideas?

I like the idea of using a Rule and have tried but can't seem to get the rule to accept a proper data selector using: Event=Before Saving Content, Condition=Content is of a Certain Type, - the Action is what is tripping me up.  I'm trying to use the Action of OG - Add Entity to Group.


texts: Does Views RSS display deals with relationship

texts:
I have a content type "Event" which has a relationship with the content type "Category", via the node reference field 'category_ref'.

The "Category" content has a field "Image".
I have figured out how to display the field "Image" in a page view listing the "Events" node, with relationship option on "Image" field.

It works just fine, except that I would like now to create a feed for this view, to export it on Facebook. But then, as there is no field to set up for RSS feed, I don't know how to fetch the image from "Category" and get it in my RSS.

The point where I'm stuck is that the relationship is set on the RSS display tab, but the image does not show.

Is there a way to do fetch datas from another content type than the one of the views via the RSS display of the Views interface?