texts: drupal_add_js does not add javascript on after_build

texts:
I'm using the following line to add JavaScript code to my module form:

$form['#after_build'][] = 'myModule_after_build'

In myModule_after_build(), I add the Javascript code with calling drupal_add_js('myJavascript','inline').

Unfortunately, it seems that the JavaScript code is added only during the first page call.
I would like to pass some arguments to JavaScript, and manipulate the content of the JavaScript, according to the options in the form.

Is there any configuration that I can set to add 'myJavascript' with different arguments to every button click?


texts: What Field type to use when setting up new Content Type

texts:
I am setting up a new content type to use with Feeds.

I've selected a Field type of text for the Date label. Is that acceptable? The date will never be entered via the user interface. Instead, it will be pulled in from the csv file using Feeds.


texts: Creating a website with search filters like amazon and Ebay. Is it possible?

texts: I want to create a website which will be a search based. It will allow users to narrow down results based on categories and tags. The website is not a shopping website but will be a collection of articles. The user will narrow down the results using categories and sub categories and various types. I want to know that is this kind of functionality obtained from Drupal. I am using Joomla and its not allowing me to do what I want.


texts: Automatically downloading libraries for a module

texts:
I have a small module on drupal.org.  Among a few other things, my module adds support for a third-party PHP library to Drupal.  Users are expected to download the module to .../libraries/ and the module provides helper functions, etc.

A few days ago I had a feature request come in.  Essentially, a user is asking for a way to automagically download the PHP library to .../libraries/ for use by the module.

Before I stamp this request as denied, I was curious whether there is a decent method to do this, and if there are any existing modules that already to this (so I can look at them for inspiration).


texts: Duplication of code when creating custom block template

texts:
I'm a newbie in Drupal but I'm working on a project with drupal 7 and I'm going out of my mind.

I have a block which content must be wraped by different links if is seen on desktop or on mobile devices.
I decided to work with a custom block template and php mobile detection, and seems to work fine except that the same code is replicated 2-3 times on the rendered site. I don't understand why this is happening, maybe you can help me...

Here is the template file for the block (block id 27)

<?php

<div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print    $attributes; ?>>

<?php print render($title_prefix); ?>
<?php if ($title): ?>
   <h2<?php print $title_attributes; ?>><?php print $title; ?>

<?php endif; ?>
<?php print render($title_suffix); ?>

<?php
  $detect = mobile_detect_get_object();
  $linkClass;

  if (! $detect->isMobile() && ! $detect->isTablet()) {
      $linkClass = "fancybox";
  } else {
      $linkClass = "infografica_mobile";
  }

?>

<a class="<?php echo $linkClass; ?>" href="#" target="_blank" rel="gallery"><?php echo $content; ?>

Here what i see with dev tools:

UPDATE:
I've tried to modify the rendering part, removing the p tag this way

echo "";
print_r($content);
echo "";

and it seems to work fine and smooth...any clue?

Thank you


texts: Disallow access to member files when they are in public file system

texts:
I have case where I want to make it impossible for the users to access file directly (http://www.mydomain.com/members/file.pdf), but want to allow downloading this file only if link is displayed on Drupal page, that user has privilege to see.

I know it can be easily done if those files are outside webroot and defined as private filesystem.

But is there any alternative solution, Apache way, php/Drupal way to achieve this for files that are not in private filesystem?

Those member files are of various extensions, so I could not just disallow by extension.

I have asked simmilar question before, but as I understood, proposed hook_file_download way works only for private file system setup.


texts: I have added the Automated Logout module, now its working fine but in user edit page "Your current logout threshold text box" is showing up what is it. How to remove this please help me?


texts: How do I create my own template files in a sub-theme?

texts:
Am new to Drupal so bear with me.

I am using Standford's Open Framework and have created a sub-theme based on it and activated it.  It works.  I can edit my sub-theme's style.css file and changes show up on my site.

However, when I create a templates directory and start adding my own templates to override the default ones, the changes are not showing up.

I copied, for example, the page.tpl.php file from the base theme's templates directory and modified it in my sub-theme. No changes appear.  If I make the same modifications on the base theme they do show up.

Here is my directory structure.  Am I missing something?  Do I have to specify something in my .info file?

`-- my-sub-theme
    |-- css
    |   `-- style.css
    |-- js
    |   `-- script.js
    |-- templates
    |   `-- page.tpl.php
    `-- my-sub-theme.info


texts:
Using Drupal 8.9.13. I cannot seem to make the site I am building functional with the Domain suite of modules installed. Symptoms:
After installing and enabling the Domain module, the site generates a general error when I log in. There is an error in the dblog:
TypeError: Argument 1 passed to Drupal\Core\Plugin\Context\ContextHandler::Drupal\Core\Plugin\Context{closure}() must implement interface Drupal\Core\Plugin\Context\ContextInterface, null given in Drupal\Core\Plugin\Context\ContextHandler->Drupal\Core\Plugin\Context{closure}() (line 76 of C:\Users\eugene\Sites\acquia\newfaces\web\core\lib\Drupal\Core\Plugin\Context\ContextHandler.php)
I narrowed it down to some kind of conflict between Layout builder module and Domain module. If either one is uninstalled, the error is gone. When Layout builder is uninstalled I can create domain records and then re-enable Layout builder. At this point there will be no errors.
When I continue to enable other modules in the domain suite, they seem to install fine, until I install Domain Source module. It seems to be in some conflict with the rules module. I cannot view user profile, including my own with the error indicating that memory of 512M is exhausted (no error in the dblog). Uninstalling either modules removes the error condition.
Please help. I don't see any similar issues here.


texts: How to disable "all" option from contextual filter?

texts:
While debugging some slow running queries I came across a "hidden feature"?  in views.
When I have a "uid" contextual filter and pass "all" as the value it will show all users.


texts: Why can't I comment on a module' project page on drupal.org?

texts:
I can't comment on the project page https://drupal.org/project/awssdk

Why is it so?

The module seems to work with long out-dated AWS SDK for PHP 1.6.2 so I just want to make a comment there to suggest the contributors to update the module and the documentation.


texts: How do I add taxonomy terms and vocabularies to an exportable deployment plan?

texts:
I'm in the process of developing an installation profile for a new site. We're using Features to export much of our functionality, and are very interested in using the Deploy module integration with UUID to handle the thorny issues stemming from exported content not having the same unique IDs on multiple deployments. Being able to export entities into a deployment plan and import them with Features would be an absolute godsend, and this is working with basic node content from what I've seen so far (I'm familiar with the concept of creating a fetch-only deployment plan and exporting it later).

However, I have a content type that references multiple taxonomies, each with a closed, pre-defined vocabulary. These vocabularies (and their terms) need to be exported, so that they can be referenced by the appropriate fields (for instance, a list of terms representing venues should be selectable from a drop-down). I haven't yet found a way to add these to a deployment plan, despite hearing on the soon-to-be-deprecated UUID Features issue queue that this should be possible. Is there something I've overlooked, or is there a better approach?


texts: How can I update the name of a taxonomy term using hook_update_N?

texts:
I have taxonomy terms of color and I made a typo in one of the color name. It should be 'Crystal Black Pearl' instead of 'Crsytal Black Pearl'. How do I change it using hook_update_N ? Thank you in advance.
function honda_model_install() {
  $term = \Drupal\taxonomy\Entity\Term::create([
    'vid' => 'honda-color',
    'name' => 'Crsytal Black Pearl',
  ]);
  $term->save();
}


texts: Some fields are not indexing in apache solr index

texts:
I have taxonomy term and date type fields in content type. But they are not displaying in facets list in admin section.

While accessing this url http://localhost:8983/solr/select I noted that these fields are not indexing to the apache solr search index.

There is one other taxonomy term reference field and that field is indexing properly.

Any one who have some idea about this?


texts:
My Goal
 * User Request for a customize version of a file
 * admin uploads the file for that user.
 * User Downloads Files.

I am stuck at how to assign a certain file to certain user. How do i accomplish this with views . My idea was to create a node with file upload field and assign certain user to it , I dont know how to do this assign part and filter things with views

Note : i am using drupal 7


texts: Can jPlayer be integrated with the Video module?

texts:
With the Video module, the admin panel shows a large list of video formats with dropdowns allowing the user to select one of the supported players. The list that is included consists of:

Divx
Quicktime
RealMedia
FLV flash
SWF flash
Director/Shockwave
Windows Media
Theora

I installed the jPlayer module and put the jPlayer library into /sites/all/libraries. Is there an established way to get jPlayer to appear in this list, or to otherwise integrate Video with jPlayer?


texts: Group Audience field in Group Content does not show any values other than None

texts:
I am a OG newbie and followed examples and created a new content type called "Team" and a new content type called "Item" and associated it as a Group Content Type for "Team".

I created a new "Team" called "Team 1" and when I try to create a new "Item", in the Group Audience field I only see "None" as an option.  When I change the Group Audience field setting in "Item" to "Select List" instead of "OG Reference", I see the "Team 1" as part of the list.

The problem is that this workaround is not sufficient because I want to get the "Create Item" link in the Team's page using Entity Reference Prepopulate module.  However, not having it as "OG Reference" causes issues with using entity reference pre-populate field setting for the Group Audience field (getting an AJAX 500 error when I select entity reference pre-populate checkbox).

Any idea what I am doing wrong?  I am using OG 7.x-2.7, Entity Reference 7.x-1.1 and Entity Reference Prepopulate 7.x-1.5


texts: How to get the value / URL of a Link field in a Twig template?

texts:
I have a custom block Type with a Link field called "field_link" (for internal links only). Within my block Twig template I want to extract the URL of the link field. How can I do that? I read some post with similar problems, but none of the solutions seems to work so far.

What I tried so far:

{{ file_url(content.field_link.uri) }}
{{ file_url(content.field_link.0.url) }}

I only get "/" but there should be "/node/1"...

This is my standard block template:

<div{{ attributes.addClass(classes) }}>
      {{ title_prefix }}
      {% if label %}
        <h2{{ title_attributes }}>{{ label }}</h2>
      {% endif %}
      {{ title_suffix }}
      {% block content %}
        {{ content }}
      {% endblock %}
</div>


texts:
I made a view, with a contextual filter in the user id. The fields are:

Name
uid
Email.

[
    {
        "username": "pruthiswebar",
        "id": "8"
    }
]

If I am logged, I can see the email, if I go to anonymous user, I can´t.
There is not a permission for "show user email" or something? How can I configure this?


texts: Why is my custom module giving a "page not found" message when using https?

texts:
I have a custom module that is a form. The first section in the hook_form() function is

if (!$_SERVER['HTTPS'] == 'on') {
    drupal_goto('https://mysite/mymodule');
}

If I comment out this section, the form works as expected. If the https redirect is left as is, I get a page not found error. This occurs only for unauthenticated users. If I am logged in, the form displays correctly.

I am on Drupal 6

EDIT: I turned off caching on my Drupal site and the form works again. The caching must have broken my form. I will see if I can find a way to not allow the form to be cached by Drupal.


texts: Allow users to edit their own content and admin-generated content

texts: On Drupal 6, how can I let registered users edit their own content and also allow them to edit an already existing admin content (just one content type) and then when saved, the user takes ownership of that node?


texts: How to configure Views to determine pages never visited by anonymous users?

texts:
I want to find out and list the pages that never get visited by anonymous users. Google Analytics just shows pages that are visited at least once.

How can I configure views to create a kind of flag for "visited" or the like?

Thanks!


texts:
I am using views and have a query to return some data. I want to take the SQL from the view and use it in my code.

The SQL the view is creating is:

SELECT node.title AS node_title
FROM
{node} node
LEFT JOIN {field_data_field_order_reference} field_data_field_order_reference ON node.nid = field_data_field_order_reference.entity_id AND (field_data_field_order_reference.entity_type = 'node' AND field_data_field_order_reference.deleted = '0')
INNER JOIN {node} node_field_data_field_order_reference ON field_data_field_order_reference.field_order_reference_nid = node_field_data_field_order_reference.nid
INNER JOIN {field_data_field_service_status} field_data_field_service_status ON node.nid = field_data_field_service_status.entity_id AND (field_data_field_service_status.entity_type = 'node' AND field_data_field_service_status.deleted = '0')
WHERE (( (node_field_data_field_order_reference.nid = '110' ) )AND(( (node.status = '1') AND (field_data_field_service_status.field_service_status_value = '1') )))
LIMIT 1 OFFSET 0

When I try and run this code in mysql I get back some errors. Such as:

It seems not to like the {}.

Is there an easy way to transform this View SQl into SQL that I can run using db_query()?


texts: DatabaseConnection Object - string does not reflect the object

texts:
So I've got a query object with the following data in it (outputted into watchdog) - this is from hook_views_post_execute() -

[#conjunction] => OR
    [0] => Array (
    [field] => SelectQuery Object
                                                                        (
    [fields:protected] => Array (
        [nid] => Array (
            [field] => nid
            [table] => na
            [alias] => nid
            )
        )
    [value] => EXISTS
    [operator] => =
                                                                )
    [1] => Array
                                                                (
                                                                    [field] => node.nid
                                                                    [value] => IS NULL
                                                                    [operator] => =
                )

Now as far as I can tell, according to this "OR" condition in db_select() this is how this is supposed to look for an OR condition.

However when I look at the string query for this, it looks like this:

WHERE (( (na.gid = :db_condition_placeholder_2) AND (na.realm = :db_condition_placeholder_3) )OR( (na.gid = :db_condition_placeholder_4) AND (na.realm = :db_condition_placeholder_5) )OR( (na.gid = :db_condition_placeholder_6) AND (na.realm = :db_condition_placeholder_7) )OR( (na.gid = :db_condition_placeholder_8) AND (na.realm = :db_condition_placeholder_9) ))AND (na.grant_view >= :db_condition_placeholder_10) AND (node.nid = na.nid) )OR (node.nid = :db_condition_placeholder_11)

:db_condition_placeholder_11 equaling IS NULL.

Now the actual query I want is something along the lines of this:

AND ( EXISTS (SELECT na.nid AS nid FROM node_access na WHERE (( (na.gid = 0)
AND (na.realm = 'all') )OR( (na.gid = 117)
AND (na.realm = 'content_access_author') )OR( (na.gid = 2)
AND (na.realm = 'content_access_rid') )OR( (na.gid = 10)
AND (na.realm = 'content_access_rid') ))
AND (na.grant_view >= 1)
AND (node_field_data_field_consultant_contact_er.nid = na.nid) ) OR node.nid <typically an entity reference to a node here> IS NULL )

I am generating it like this:

$query->condition(db_or()->condition($inside_subquery, "EXISTS")->isNull($values[0]));

What exactly am I doing wrong? The $inside_subquery variable has all of the data that should be in the EXISTS in the above query.

Why does the string value differ from the query object?


texts:
Selling files online with the following pieces:

Commerce 7.x-1.8
Commerce File 7.x-1.0
Mime Email 7.x-1.0-beta3

I would like to provide people with a document attached to an email. The commerce-checkout-rules almost gets there. What is the token replacement that 'provides a list of files; one per line'? Or otherwise, how do we attach the files being checked out?


texts: Better Search Api Solr score sorting for strict word match in Drupal

texts:
Given the following configuration:

A Search Api views page(connected with a Solr server) with a "Search: Fulltext search" exposed filter searching only on one "Full Text" aggregated field (Node Title).
All the content is in Dutch;

The issue:

Having a list of node titles as following:

AVENE CREM NUTRITIVE COMP POT 50 ML
Widmer Nutritive Creme Parf 50ml
AVENE TRIXERA NUTRITION NUTRI-FLUIDE 400
NUTRITIC MEMOTONIC 7 FLAC
NUTRITIC VIT A-D GINKGO 30 TABL

Searching for the keyword "Nutritic" will return me the following order:

NUTRITIC MEMOTONIC 7 FLAC
AVENE CREM NUTRITIVE COMP POT 50 ML
Widmer Nutritive Creme Parf 50ml
AVENE TRIXERA NUTRITION NUTRI-FLUIDE 400
NUTRITIC VIT A-D GINKGO 30 TABL

It seems like the keyword "NUTRITI" is considered the same as "NUTRITIC".

How can ensure that searching on keyword "NUTRITIC" the content containing specifically "NUTRITIC" will have the bigger score than others?


texts: Possibility to apply a patch to a target directory with Drush make?

texts:
Is there any way to declare target directory for a patch in a Drush make file?

I need to apply a patch to a subfolder of a module. The reason is that CiviCRM's project is composed from multiple repositories (the patch is from the civicrm-drupal repository, which corresponds to civicrm/drupal in the packaged module).

There was a proposal along these lines in #745224, but ultimately only support for -p0 and -p1-type patches was committed.

(I'm now using a work-around by declaring a library in that location and applying a patch to it, but a cleaner way would be nice).


texts: When viewing a product node, how to show/ enable the original node title?

texts:
I am using commerce in my drupal site, but the node title is not there. Debugging it in the page.tpl.php returns an empty string ''. I know you can enable the title in the display settings of the content type and product variation, but this is rather a field within the node article, that has no influence of the title not being shown within the page template.

Obviously, the title is being set to '' somehow, but I cant figure out where this happens or, even more importantly, how to change this with my custom module.

Any help is greatly appreciated.


texts: How to make custom entity properties available on entity_load?

texts:
I am altering another entity by adding some more (read only) properties to it.

<?php
hook_entity_property_info_alter(&$info) {
  $info['entity']['properties']['entity_edit_url'] = array(
    'label' => t("Edit URL"),
    'description' => t("The edit URL of the entity."),
    'getter callback' => 'entity_get_custom_properties',
    'type' => 'uri',
    'computed' => TRUE,
  );
  ...
}
?>

These properties are working fine in rules and entity metadata wrappers, but on entity load they are not present. This is tested with:

<?php
$e = entity_load('entity_type', array(1));
dpm($e);

// Expected
$e->entity_edit_url = 'something';
?>

I could use hook_entity_load to fetch these properties from the database on load, but that feels like an ugly workaround:

<?php
function hook_entity_load($entities, $type) {
  if($type == 'my_entity') {
    foreach ($entities as &$entity) {
      list($id) = entity_extract_ids($type, $entity);

      $entity->entity_edit_url = 'user/' . $entity->uid . '/entity/' . $id . '/edit';
    }
  }
}
?>

I can't figure out why it does work in rules. Am I loading the entity in a wrong way, or is there a trick to attach these additional properties to the entity? I already provided a getter callback for fetching these properties, so doing it again in hook_entity_load feels wrong.


texts:
I have a D7 installation with about 2k "project" nodes, which have a multi-entry field "team members" used to control view and edit access.

So far, I have my (pretty complex) logic inside node_access, and it works fine. But views (e.g. a "new projects" feed) don't respect node_access. The mymod_node_access hook is called (I see it with dpm()), but the nodes still appear in the view result.

Obviously I could simply hide the elements using a view field template, but that breaks the paging system (e.g. user selects "10 projects per page", but sees only four).

How can I make the Views module respect node_access as a filter?


texts: How to allow anonymous user for checkout process?

texts:
When users buy one of our offers (premium offer), the site will create a user account, send a link to his/her account to reset the password, etc.

How to achieve this?


texts: Creating and Linking anchors using CKEditor

texts:
I am using CKEditor in my drupal 7 website. I am designed a new content type, in which I am writing about project activities in the following manner.

(1) Project A [anchor]
     This project describes about the design and analysis of Binary Search Tree
(2) Project B [anchor]
     This project describes about the design and analysis of Red Back Tree

Now, from a different page, I want to provide a link to anchors in following way-

The Binary Search Tree [as described here] also called an ordered or sorted binary tree.

I wanted to know using CKEditor-

How to create links (anchors) inside a page?
How to add these links to text on a new page?


texts:
I have a view which has to display a list of nodes: title, subtitle with the container that links to the single node.
Difficulty comes when I want to display this view following this from bootstrap 3.
I know how to rewrite each single field, but in this case I should put the node link in a container and then, nested inside, the "title" and "subtitle" fields.
I think I should rewrite the $rows but I'm not sure if it's the correct path. Besides that, I don't know exactly how $rows is organized (and dpm($rows); apparently didn't work, maybe this is related to the theme).


texts: How can I programmaticaly submit the user edit form in Drupal 8?

texts:
I need to create a logout button in my app, and I do not know how to revoke simple_oauth tokens programmatically, but I have noticed if the user saves their profile form (form_id: "user_form") in Drupal, it revokes the user's access token.

So I'm wondering if there is a way to programmatically submit the form so I can do so in a logout endpoint for my app.

That is, unless someone can point me to the specific code that revokes a user's access token when the user edit form is saved, so I can fire that hook  more directly.

Because the oauth2_token table does not reference the associated user (auth_user_id is always zero), I don't know how to look up a token by UID for the purpose of revoking the token.  Thus, even though it seems like a hack, the only thing I can think to do is to try to submit the user edit form programmatically.

UPDATE: I was wrong about "auth_user_id is always zero".  See my answer below.


texts: How to append fields to published node in drupal?

texts: A node once published should not be edited, but extra fields can be added to that node. How can i do it? For example , lets say i have a content type called 'employee'. Once i create this content i cannot edit that node but can only add more information to that node. this extra information must be stored in the node's column. Is it possible ? or is there any other way?


texts: Changing a user object property that is loaded from the users table

texts:
In a module I developed, I need to change $user->language for those users who don't have the "change own user language" permission, a permission the module itself defines. The module is actually doing two things:

Hiding the language selector in the user edit form for those users who don't have the permission to set a language by setting its #access property to FALSE
Loading the default language for those users

The first part works. For the second part, I was first using hook_user_load() but due to the following warning shown in the documentation page, I changed the code to use hook_init().

  Due to the static cache in user_load_multiple() you should not use this hook to modify the user properties returned by the {users} table itself since this may result in unreliable results when loading from cache.

The problem is that with hook_init() I am not doing anything when a module loads a user object, sets that as current user, does something, and then changes back the global $user.
I know I could load the language in a custom property, but I should still need to change the $user->language property before Drupal or any module uses it.

How can I change a user object property that is loaded from the users table?


texts: 3 separate fields,one views exposed filter

texts:
I would like to have a Rent/Sell radio button for 3 content types.
Then I want to show this radio buttons on a views exposed filter.
How is this possible to do without sharing the radio buttons field on the 3 content types i.e. use a different field on each content type (so as to make easier to upgrade to D8).


texts: How to send an email to all members of a group after the group is flagged?

texts:
I use the Group module. I create a flag to mark groups. I wish that when a group is marked, an email is sent to all members of that group. How to do this ?

I created the following rule, but I find nothing in "conditions" in relation to the groups :

{ "rules_email_groupe" : {
    "LABEL" : "Email groupe",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "flag" ],
    "ON" : { "flag_flagged_achats_groupes" : [] },
    "DO" : [
      { "mail" : {
          "to" : "contact@mathieulebert.xyz",
          "subject" : "Invitation \u00e0 la vente group\u00e9e de [flagged-group:title]",
          "message" : "Bonjour,\r\n\r\n\r\nle groupe [flagged-group:title], vous invite \u00e0 sa vente group\u00e9e.\r\nElle commencera [flagging:field-flag-date:value] et se terminera [flagging:field-flag-date:value2].\r\n\r\n\r\nCordialement,\r\nL\u0027\u00e9quipe [site:name]\r\n[site:url]\r\n\r\nPour rester inform\u00e9 des nouveaut\u00e9s et b\u00e9n\u00e9ficier de nos offres promotionnelles, suivez-nous sur :\r\nhttps:\/\/www.facebook.com\/S1biosecom\r\nhttps:\/\/twitter.com\/S1biosecom\r\nhttps:\/\/plus.google.com\/+S1biosecom\r\nhttps:\/\/www.pinterest.com\/S1biosecom\r\n\r\nPS : ceci est un mail automatique, merci de ne pas y r\u00e9pondre.",
          "from" : "[site:mail]",
          "language" : [ "flagging-user:language" ]
        }
      }
    ]
  }
}

Any suggestions?

Some more details about my setup:

An overview of the Flags I've defined:

More info about some of my fields (I also use Display Suite):

The fields I defined for my Group Type "Entreprise":

Update: By using the Rules Component included in the answer to "How to pass a Flag field's value to a Rules Component triggered by the flag?" I'm getting closer, but I still have to find out what to do with those 2 date variables I've to pass to that Rules Component, as shown here:


texts: How can I remove the drupal favicon, I have tried to change the theme settings and global settings but it's not changing anything because I have to put another link if I want to replace it with my own, but I don't want to replace it I want to remove it.


texts: JS script in theme is ignored for anonymous users

texts:
It just discovered that my script.js in my theme is ignored for anonymous users. But only on certain pages. When logged in everything works on all pages. When logged out things only work in some content nodes. For example I have a navigation menu outside of the system menu. It's an exposed block from a view, that I use as a navigation menu to mirror the taxonomy (the taxonomy module does not work for me). I use the theme's script.js to collaps and expand menu items as appropriate. But this is ignored when logged out on most pages (but as I said it works when visiting some content nodes). What is this?

I also discovered that flexslider doesn't wok when logged out. But it works in content nodes... I must be missing something.

I have tried adding:

drupal_add_library('system', 'jquery', 'ui.sortable', 'ui', 'drupal.collapse');

... in my template.php (in template_process_page, and I also tried to add it in template_preprocess_html).
In the Firebug "Net" tab I can see that my script,js is loaded together with jquery and a whole bunch of js files. So if everything is loaded, why is it ignored on certain pages when logged out? Any ideas?

Edited... I also have tried to add break points in my script.js file and it is clear that the script is ignored all together on certain pages.


texts:
I have a node with nid = 548754 and I needed to be 301. Is there a safe way to do this? There are a lot of tables related to 548754.

What if I export the database, then open sql file, replace the number and then import the database. Will this work?


texts: How can I downgrade a module with Composer?

texts:
I updated the following module to its stable version :
https://www.drupal.org/project/commerce_pricelist/releases/8.x-2.0-rc2
This module completely broke my site. There has been no database update. How can I revert to the RC2 version ?


texts: How to remove a "new" indicator when clicking on a link?

texts:
I'm showing a list of content in a view and there is a red "new" indicator (field content: has new content) next to the title link. The problems is that when you click a link to read the content and then click back the "new" indicator is still shown.
I don't want to reload the list page every time I click the back button. I'm thinking about using some javascript/css to remove the "new" indicator when you click on the link. Is there a "Drupal" way of doing this?
Screenshot:


texts:
A view I'm working on has a linked Title field. By default, this field should link to an internal page with the [nid]. E.g. http://www.example.com/node/[nid]

However, there is a second link field where, if filled in, the link should be re-written to go to the specified link.

So, if the link field is blank, link to a URL with the [nid]. If the link field is filled in, link to the specified URL. I'm unsure of how to have a default behavior and then override it.

How could I accomplish something like this from within Views? Thank you!


texts:
I already browsed several posts but did not find an answer. I want to be able to make a list view that shows all my articles. Additionally the articles' teasers should show if the article has been published or not yet.

My Problem: The publication status doesnt exist as a field, so I cant add it to the lists' teasers. How can I achieve this ?

Thanks in advance,

Martin


texts: Automatic Validation Using drupal_form_submit

texts:
I have a content type (call it my_type) with some required fields. One of the fields uses the email module, so if I try and create a my_type node using Drupal's built in node create page and I put 'notanemail' as the email address, the node will not be created and I get an error saying 'notanemail is not a valid email address'.

When I make a node programmatically using drupal_form_submit, it does not do the validation and the node is made even though I put incorrect values in fields.

I don't want to implement hook_validate if I can avoid it. I would rather use the build-in validation. Is this possible?


texts:
How do I set a variable to the value of a field another field?

For example, what is the equivalent of the following code, which should set the value of video_Source to the value of the field that is not empty/null?

{% set video_Source = content.field_video_upload or content.field_video_youtube %}


texts:
This relates perhaps more to Sass then Drupal per se. But, it does come from a Drupal contrib theme; so- I'm hoping someone has encountered this or simply knows the answer.

Question is: where are some of the Sass variable set. For example $nav-height

In the sass file _responsive.scss the following code

/* Navigation bar */
@media all and (min-width: 480px) {
  #main {
    /* Move all the children of #main down to make room. */
    padding-top: $nav-height;
    position: relative;
  }
  #navigation {
    /* Move the navbar up inside #main's padding. */
    position: absolute;
    top: 0;
    height: $nav-height;
    width: $zen-grid-width;
  }
}

No where can I fine where $nav-height was initialized or set. Yet, when sass is compiled, magically - somehow, the value is there.

Same question holds for the next variable "zen-grid-width".


texts: Send email to different email depending on taxonomy term

texts: This was fairly simple to do in D7 and is a common request. How would I send an email to a different email address depending on a taxonomy term chosen from a dropdown box on the contact form?


texts: Managed file: the file used in the field may not be referenced

texts:
I am having some issues with the managed_file type. Whenever I try to edit and save a form that has a managed_file element in it an error occurs: The file  used in the Picture field may not be referenced.

This is the code I'm using:

function foo_form ($form, &$form_state, $foo) {
  ...
  $form['file'] = array(
    '#type' => 'managed_file',
    '#title' => t('Picture'),
    '#default_value' => (isset($foo->file->fid) ? $banner->foo->fid : ''),
    '#upload_location' => variable_get('foo_upload_location'),
  );

  if (isset($foo->file)) {
    $form['current_file'] = array(
      '#type' => 'hidden',
      '#value' => $foo->file->fid,
    );
  }
  ...
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
 }

function foo_form_submit ($form, &$form_state) {
  $foo = (object)$form_state['values'];

  $current_file_set = isset($form_state['values']['current_file']);

  if ($form_state['values']['file'] != 0 && !$current_file_set) {
    // Load the file uploaded in the form.
    $file = file_load($form_state['values']['file']);

    $file->status = FILE_STATUS_PERMANENT;

    file_save($file);

    $foo->file = $file->fid;
  } else if ($form_state['values']['file'] != 0 && $current_file_set) {

    // If we are uploading a different picture, delete the old one and save the
    // new one. If not, don't do anything.
    if ($form_state['values']['current_file'] != $form_state['values']['file']) {
      file_delete(file_load($form_state['values']['current_file']));
      // Load the file uploaded in the form.
      $file = file_load($form_state['values']['file']);

      $file->status = FILE_STATUS_PERMANENT;

      file_save($file);

      $foo->file = $file->fid;
    }
  } else {
    file_delete(file_load($form_state['values']['current_file']));
    $foo->file = null;
  }

  ...
}

I traced the error back to the file_managed_file_validate function in modules/file/file.module but don't know anything about the file references.


texts: Views field: how to add html 'title' attribute to link

texts:
In views fields like [Content: Title] and [Content: Taxonomy] there is the possibility to have the content displayed as link. Is it also possible to equip these link with a html 'title' attribute?

Alternatively, is it possible to equip all links on a drupal site with html 'title' attributes?


texts: Autosave returing Service Unavailable Without any response text on restore

texts:
In autosave v:7.x-2.2, I am getting this error:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /autosave/restore/post-content-node-form/1361446295/VJ5GdML22KqYgVzxuQXndTd3ibj2iz6mfCg4l-RafXo/bartik
StatusText: Service unavailable (with message)
ResponseText:

I have searched for it, but didn't get any solution yet.
Any idea, how can I resolve it.

I have checked DB and it is storing entry properly.

-- Thanks


texts: Date Field Type - Text Field Widget is Gone?

texts:
I am noticing that the Date field type only has the availability of three widgets:

Select list
Date and time
Select list, no time

Can someone tell me why the "Text Field" widget is gone?  Or am I missing something?
I have a use case where the user needs to be able to copy the date from another source and paste that value into the date field.  It would be too time-consuming to have to pick the date from a "date picker" widget.  It would be ok if it were a one-off situation but this user needs to be able to enter several at a time.


texts: Uploaded file not shown in custom content type / Image not attached to content type

texts:
In Drupal 7, I am trying to upload an image that belongs to a custom type.

I click the Browse button, choose the file and upload. Until there, all seems to work well.

However, when I click next, instead of the add alt, title and text, I get only a screen that says Destination *, and with a Previous and Next buttons, as shown below. The save button is never displayed, and the image is not shown.

However, the image is there if I check the files through the admin, moreover, all goes well If I add the image through the file/add, it is just in the custom type that I get the error.

I am logged in as an administrator and I have all the permissions checked in Media and File Entity

My files folder permissions are 755, and the javascript console shows:
'Attr.nodeValue' is deprecated. Please use 'value' instead. in jquery.js

Resource interpreted as Script but transferred with MIME type text/html: "about:blank" in
browser?render=media-popup&types[]=image&activePlugins=&enabledPlugins=&schemes[]=public&schemes[]=…:92 (anonymous function)

Thanks in advance for your help.

Update, this doesn't work with Image widget nor Media Browser widget. Same site works in PROD, I suppose it is something with the file system settings?


texts:
Is there an automated migration for UI strings (Locale module) from Drupal 7 to Drupal 8?

I have a Drupal 7 site in English and French. Some of the French strings used in the user interface have been customized (on /admin/config/regional/translate/translate). Can those customized strings be automatically migrated to the Drupal 8 site?


texts: Let users change their Password in Drupal 6 WITHOUT having to type email in

texts: On Drupal 6, When a user goes to 'edit' their account, they must also enter their email to be able to change the password. Is it possible to populate the email field with their stored address to avoid this?


texts:
Now i know there are some ways that a redirect on login can be setup, ie using views etc, but i think my issue maybe a bit more complicated.

When a user accesses a node for example where they are prompted to login, from here they are directed over to the /user/login page.

I want the user to be redirected back to the page they were before they came to the /user/login page, with a few exceptions of course.

How can i get the user journey to be...Node -> user/login -> redirect back to Node?


texts: How to assign drupal webform to drupal node/block?

texts: i am using drupal 6.0 and webform modules to create webforms but i have no idea about asigning webforms to drupal node/block. so please help me and give some ideas and suggestion about this.


texts: Render array only working with numeric keys

texts:
I have a FieldFormatter that outputs a DIV, a table and attaches a JS library.

Normally in Drupal (e.g. Form API) it's possible to label the render array keys however you like? Weirdly in this case, only numbering them seems to work.

If it's a typo, I'm not spotting it, and there are no errors in the log.

Are there differences in how FieldFormatter rendering works?

Working numeric keys:

  public function viewElements(FieldItemListInterface $items, $langcode) {

    // various logic ...

    $build = [];

    $build[0] = [
      // placeholder div for the YouTube player
      '#type' => 'container',
      '#attributes' => [
        'id' => ['youtube-timecode-player'],
      ],
    ];

    // various logic ...

    // attach our timecode.js javascript make the video ID available
    $build[0]['#attached']['library'][] = 'mymodule/youtube_timecode';
    $build[0]['#attached']['drupalSettings']['mymodule']['video_id'] = $video_id;

    $build[1] = [
      '#type' => 'table',
      '#caption' => $this->t('Questions'),
      '#header' => [$this->t('Time'), $this->t('Question')],
      '#rows' => $timecodes
    ];

    return $build;
  }

Non-working text keys (no output and no errors):

(I've changed 0 to video and 1 to timecode_list)

public function viewElements(FieldItemListInterface $items, $langcode) {

    // various logic ...

    $build = [];

    $build['video'] = [
        // placeholder div for the YouTube player
        '#type' => 'container',
        '#attributes' => [
            'id' => ['youtube-timecode-player'],
        ],
    ];

    // various logic ...

    // attach our timecode.js javascript make the video ID available
    $build['video']['#attached']['library'][] = 'mymodule/youtube_timecode';
    $build['video']['#attached']['drupalSettings']['mymodule']['video_id'] = $video_id;

    $build['timecode_list'] = [
        '#type' => 'table',
        '#caption' => $this->t('Questions'),
        '#header' => [$this->t('Time'), $this->t('Question')],
        '#rows' => $timecodes
    ];

    return $build;

}


texts: Excluding empty(Null) fields when using EntityFieldQuery query condition

texts:
Is it possible to select all of the entities who's xyz field is empty?

I tried soemthing like this:

->fieldCondition('field_name', 'value', NULL, 'IS NOT NULL');

However, this doesn't seem to work.

Any ideas?


texts: Set default value for time field in custom form

texts:
I am trying to set a default value for time field only in a custom form using date module API. The code is as follows:

    $today = strtotime('00:00:00');
    $form['schedule_this_node']['scheduled_time'] = array(
    '#type' => 'date_popup',
    '#date_format' => 'd-m-Y h:i A',
    '#date_year_range' => '0:+3',
    '#title' => t('Schedule At'),
    '#required' => TRUE,
    '#default_value' => date('H:i', $today),
    '#attributes' => array('class' => array('date-picker')),

But the above code does not set a default value.Does #default_value works only in date('Y-m-d H:i', $today) format only with date API? is it related to Date popup form field doesn't show the default value correctly?


texts: Possible to manage display of Profile2 profile fieldset on user registration

texts:
Using profile2 module I have set my Student profile to "Show during user account registration". This shows the fields I have created for the profile2 Student profile in a fieldset inside the user registration form.
I am now struggling to gain any control over the display of my profile2 Student profile fields on the registration form.
It is possible to manage the display of a profile2 profile displayed on the user registration form through display suite or another method, or is the only option using hook_form_alter.

Thanks


texts: How do I fetch the values of an entity's field?

texts:
How to query all the values of a particular field. I used Drupal\Core\Database\Connection object to fetch the values as below:

$connection = \Drupal::database();
$result = $connection->select('node__body', 'n')
  ->fields('n', array('body_value'))
  ->execute()->fetchCol();

Is there any Drupal 8 API specifically for this?  I need to fetch all values of the field and fetch the field values for a particular node bundle.


texts:
I'm really need a good documentation or some kind of HowTo for Google Font module,i installed it and i choosed my Google font and what after? i m asking if i need to do some manual css or php work or just some other configuration in the GUI .
Thank you very much


texts: Allow file access to specific users in Drupal (not roles)

texts:
I have historical data recorded in pdf files for our clients. Now I am developing a website (in Drupal) from where clients should be able to access this data. The problem is that i don't want this files to be available to anyone else than the user to whom the information belongs.

Since this data is periodically recorded I could store it in a specific folder for each user.
My question is that if it's possible to give access to this folders or its content to specific users in Drupal. Because the alternative would be to create a Role for every user which is not good.


texts: My admin panel view fancy box not working

texts:
I am new to drupal. I searched this problem in google but could not get the solution that could solve my problem. My problem is,

I used a fancybox for one of my news post page. It uses latest version of Jquery. When, I use this, my fancybox works well. But, when I come to view page, My light box does not work there. Like,

When I click on add button [Add button to add fileds or filters ], the sceen goes black and nothing happens. When I remove the fancybox, it works well. It is important for me to use fancybox. Please suggest how to solve this problem.


texts: Markup filtering at theme level (security)

texts:
Please could someone advise if any sort of sanitization/filtering is required for the #markup below i.e. check_markup(), check_plain(), etc

The $title variable is basically just from drupal_get_title().

function THEME_form_store_search_page_alter(&$form, &$form_state){

        // Some code goes here to remove title from page and use in form (not part of the question)

    $form['title'] = array(
        '#type' => 'item',
        '#markup' => '<h1>' . $title . '</h1>',
        '#weight' => -100,
    );

}


texts: Users chosen from a field in a content type see only their result

texts: I have a list of students who are users in my Drupal 8 site. I want to publish their result but I want each student to see only his/her result. I have a content type where I can get marks and an entity reference field from which I can get users. As I am the author of the node, I cannot use the content-author relationship. I have to match the user id chosen in the node to the logged in user. I am trying to use contextual filter on the entity reference field from where I get the user list, but not getting any result. Please help me with the same.


texts: How can I create a variable with different values for each domain using Domain Access?

texts:
I have a numeric value that is unique to each domain (using Domain Access) on my site. I'd like to use the same variable name so I can use the same theme and display this value on all domains. Is this possible?

I'm currently defining the variable in a custom module, but I'm only storing 1 value. Can I alter the code in the custom module so that each domain can have it's own unique value for this variable?

UPDATE:

Adding the following when defining the variable in my custom module worked :D

'multidomain' => true,

I can edit the variable through admin/config/system/variable/edit/ and I get unique values across my domains stored in the variable_store table. The problem I now have is that I want to create an admin form for getting/setting a bunch of domain variables and the usual variable_get/variable_set don't work...any thoughts?


texts: Administer block permission let the user to see admin theme name

texts:
I gave the site admin role permission to administer blocks, but the problem is in admin/structure/block page, there is a tab that shows the admin theme name (Rubik).

he can click on Rubik but doesn't have permission to see the page.
what I want is to hide the tab.

other issue is in admin_menu module under structure > blocks there is a Rubik item too, which shouldn't be there too since the user doesn't have the permission to edit admin theme blocks.

So I'm wondering why does rubik block page link shows up!


texts: print individual field inside views-view.tpl.php

texts:
I need to theme my view inside views template. Inside custom views-view.tpl.php template I can add individual fields inside loop:

<?php foreach ($view->style_plugin->rendered_fields as $delta => $item): ?>
<?php print $item['myfield1']; ?>
<?php endforeach; ?>
//after a loop I can add any other field for custom theming like so:
<?php print $item['myfield2']; ?>

Question: How can I add another field before the loop is executed? I tried this:

<?php print $item['myfield3']; ?>
<?php foreach ($view->style_plugin->rendered_fields as $delta => $item): ?>
<?php print $item['myfield1']; ?>
<?php endforeach; ?>
<?php print $item['myfield2']; ?>

But the field3 is not rendered because the $item is not defined, I think.

I am not php programmer so I came up with a dumb workaround

<?php foreach ($view->style_plugin->rendered_fields as $delta => $item): ?>
<?php endforeach; ?>
<?php print $item['myfield3']; ?>
//field is rendered
<?php foreach ($view->style_plugin->rendered_fields as $delta => $item): ?>
<?php print $item['myfield1']; ?>
<?php endforeach; ?>
<?php print $item['myfield2']; ?>

What is the correct way of displaying an individual field without putting it inside foreach loop?

Thank you


texts: How to make views header sticky while scrolling?

texts: I have created report using drupal views and i used views_merge_rows module. Now i wanted to create sticky header of report table. Can any one please help me.


texts:
I am trying to understand the Views relationship. As I am searching the tutorials, it all described, "When you want to include data which is not directly available Views relationship lets you include that data through the common connector(joint)." Now in theory it is very straight there is a some connector which does provide the data, but How to get visualize this thing in the Views User Interface.

Let me put this way for the ease of visualization and understanding, Lets say, there is A, C and B in the following image, where C is a connector, A is data available and B is the data which is not directly available. So how can I find the A, B and C looking at Views User Interface, Hence I can Put All this three on the paper and put the logic.

Why I am putting this way, because after observing too much, I realize that why people have difficulty in understanding the views Relationship is that, what comes from  where are not so clear, hence people gets confuse which content comes from  where and how they connect each other and which one is actually not accessible. If this gets clear, the understanding of Views Relationship will be much simpler.


texts: How to hide a field when its value is set to zero

texts:
I want to hide a field on a node when its value is set to zero using a content type. Here is what I had done so far to achieve my goal.

function pay_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  global $user;

  if ($node->type=='salary_info' && $op=='presave') {
    $public_holiday = $node->field_sstru_public_holiday[0]['value']; // here I get the value that I set to 0(No) or 1(YES) using a select list.

    if ($public_holiday == 0) {
      $nid = node_load(207919); // load node where i want to unset this field
      unset($nid->field_pd_public_holiday[0]); // here iam wrong and confused
    }
    else {
      drupal_set_message("HOLIDAY");
    }
  }

what should I do to unset my field?


texts: Add a display by copying settings from another display in Views

texts: I may be missing the obvious, but how can I add a display in a view (content pane for instance) and have it copy all the settings (fields-relationships-headers-etc) from another display in that view? (in my case a page).


texts: Drupal 6: CCK Images broken (because of path) on multisite after copying/moving site

texts:
I've just encountered an issue I haven't seen seen before: after copying the dB/files to a new location on the server, none of the CCK images are working, regardless of if ImageCache is used or not. In other words, even when editing a node, the image preview is missing because the path is obviously wrong.

For one example, the path should be /sites/dev-[site-name]/files/homebanners/[image-name].

Instead it is /sites/dev-[site-name]/files/sites/[original-site]/files/homebanners/[image-name].

What I can't figure out is why.

Here's the steps taken:

Copy the dB
Copy the files. I forget why but the new sites/[site-name] mapping changes to sites/dev-[site-name] for the dev site (where the images are broken).
Adjusted .htaccess RewriteBase & Rewrite Rules, and the base_url for each
settings.php file
Set the new files location at admin/settings/file-system
Cleared the cache For the imagecache files, and used Drush to flush and re-build the images

For all but one site, the files use the Public setting, but the problem persists regardless of if the files are set to public or private.

Any help would be most appreciated.

Thanks,

Dan


texts: Exist a product discount in Drupal Commerce

texts:
I'm using Drupal commerce kickstart. I installed Commerce sale price to manage the discounts for specific products. This is a great module, the only bad thing is that this module  actually creates another price to link to products. So if I use the filter price, this one will filter either regular price or sale price, but never both together.

I know that I can create discounts with rules, but I would like to find something simple,  that can be set up easily when the customer creates a product.

How would you fix this issue ?

Thanks


texts: How can I make changes to "people" page?

texts:
Drupal have a list of users with following link - my_site/admin/people
I have some boolean field for every user and I want to show on this page users, who have true value of this field.
How can I manipulate the content of people page.


texts: How do I prevent D7 exposed filter on end date from reverting to start date if no end date has been entered?

texts:
I have a "membership date" field with an optional enddate and want to create a view showing membership list at a selected date (exposed filter). The basic logic is clear: nodes should appear in the view IF (startdate <= filterdate(exposed) OR startdate is empty) AND (enddate > filterdate(exposed) OR enddate is empty). There are two problems:
1) the enddate apparently defaults to the startdate if the "show end date" checkbox is not activated.
2) the start and enddates are apparently not "NULL" if they haven't been entered, so filtering on "is null" or "is not null" isn't working as expected.

So the filtered view now showing
a) nodes with a start date less than or equal to the filter date AND an end date greater than the filterdate (as expected)
b) nodes with a start date greater than the filterdate, but no end date (this is NOT expected, but apparently due to the empty enddate being "replaced" by the start date and then fulfilling the condition set for the end date)
The view is NOT showing
c) nodes with a start date prior to the filterdate but no end date (this is obviously an essential group of nodes!)
d) nodes with neither a start or end date (this group should be shown to allow missing data to be completed)

I am looking for some way to identify and filter for nodes with no actual enddate. Any ideas?


texts: Use field from current node in filter in view

texts:
I have a content type called 'article_landing' and a content type called 'article'.

They both have an entity reference field called 'field_focus_area'.
I'm attempting to create a view that appears as a block on an article landing node and only displays articles that have the same field_focus_area as the current node. I'm having trouble figuring out how to do this though. I thought this would need to be accomplished with contextual filters but I'm not getting any results.
Below is the method I was using.

I also tried using regular filters and using tokens like [node:field_focus_area] but that didn't work either.

Is there a way I can use fields of the node that a view block appears on inside filters in the view?


texts: visibility of a view based on current node field

texts:
I am displaying a block of related articles in node page using views. I want to hide a view on node page if certain entity field on this node is empty. My view has contextual filter with default value node nid (relationship to entity ref. field) and relationship to entity reference field. How is it possible to do?
My aim is to show block in sidebar or mail content based on what is in the field (n/a or sidebar for example). Or is there any better way to show that block on various positions of page?
I use context module so I would create views - one for sidebar and second for main page. One would be set to show only if field is empty and the second one opposite.
Thank you.


texts: Node reference: Select an exisiting node, or create a new one

texts:
I am using Drupal 7, with the References module installed.

I was wondering if there is a way (or perhaps another module) so I can select an existing node from the list or create a new one on the fly (ajax or non ajax)?

So for example I have a button for create new node and automatically select the new node as a reference?

I'd like to have the node reference as a LIST only, not auto complete.


texts: Showing content on pages without taxonomy

texts:
I have setup a drupal site so that a block is showing specific content on pages with the same taxonomy term as the block.

Now I am trying to get some sort of default content for pages without taxonomy terms.
I want the block to show all the content without taxonomy terms attached on pages without any terms attached (such as the front page and some sub pages the client makes himself).

The block in question is a slider and it would be silly if the client would see the slider disappear on pages he creates due to taxonomy.

How can I achieve this?


texts:
I have problems with a Drupal 7 site. Sometimes, when I try to log in as non-admin user I am not able to login, despite typing in the correct email and password (I am using the Email Registration module). There is no issue with this module because from the very first day after I installed it, it worked well. However, in the last couple of days or week I am getting errors for when I try to login.

I logged in as admin and changed the password for the non-admin user, after doing that, I was again able to login on my site.

I got this error sometimes, but it is not frequent.


texts: Drupal 7 - Advice needed to accomplish the idea of embedding a view in a view

texts:
Using Drupal 7 - I have a view that displays all project assignments per employee.  This view works properly and is displayed as a block on Department nodes.

I have another view that displays a page,"Department Directory".  Where the directory lists fields of such as Department Name, Address, Phone, Fax, Email.

The idea I am trying to accomplish is to have a list of fields of the department, and then have it list the employee assignments. Example:

View Page: Departments:

Finance Department

Address 123

555-555-5555

Email@mail.com

(This is where the views employee assignment block fields would be displayed)

PERSONNEL ASSIGNMENTS:

John Smith:  Complete Budget

Alan Wayer:  Generate Monthly Expense Reports

Upon doing some research, the Views field view module gave me the results I needed, however, I read that this module is resource heavy.  Is there a more efficient way that this can be accomplished?


texts: Is it possible to collect credit card info and address info on separate pages in Commerce 2?

texts:
I want my checkout flow to look like this:

Users enter their credit card information and press "Next."
Users enter their address information (customer profile), then press "Next."

In the default Commerce workflow, users enter their credit card info and address on the same page.

I want to split credit card info and address info into different pages.

How can I do this safely?

Why do this?

Because if a user makes an error when typing their address and validation fails, it also resets the credit card information.  I want to have the user do the credit card and address info separately so if validation fails, they only have to re-input one or the other.


texts:
Is it possible to exclude a domain name in robots.txt?

I have a single Drupal site with multiple domains pointing on it. For example our dev and staging server are being crawled by Google when our .htaccess password protection is disabled.

I don't intent to block any access in our development server but to tell search engine bots to stop indexing all the contents when the domain is/are dev or staging.

Basically I am seeing some of the links pointing in dev servers when I search some of my content in Google.

Is there any way or any module that could handle this?

EDIT:

Here's how I ended. Inside theme_preprocess_html().

// Avoid search engines to index dev and stage domains.
  $restricted_domains = array('dev.mydomain.com', 'stage.mydomain.com', 'editorial.mydomain.com');
  if (in_array($_SERVER['HTTP_HOST'], $restricted_domains)) {
    $meta_robot = array(
      '#tag' => 'meta',
      '#attributes' => array(
        'name' => 'robots',
        'content' => 'noindex, nofollow'
      ),
    );
    drupal_add_html_head($meta_robot);
  }


texts: How to display the title at the end of the breadcrumb?

texts:
I would like the page title to be displayed as a part of the breadcrumb, at the end of the preceding path.

I've got the following code.

<?php print $breadcrumb; ?><?php print $title; ?>

I have checked the following option in appearance/settings: Append a separator to the end of the breadcrumb.

If the page is a top level page, the breadcrumb displays correctly; however, for any further level pages, the title doesn't display, but just the previous path.

How do I change this to get it to work?

This is what I would like to do: Adding the page title next to the breadcrumb.

I've now got the following code.

<?php print $breadcrumb . $title; ?>

The page title only displays for top level pages. If a page has parents, then the title doesn't get displayed. I've cleared the cache, but still no luck.


texts: Zero pad Drupal 7 Form API Date Control day and month HTML select element

texts:
I'm using the Form API Date controls for my form, and I am wondering if there is a way to zero pad the month and day values in the HTML select elements for values less than 10 at declaration time. I am using the following render array declarations in the page callback function.

$form = array();

$form['date_from'] = array(
    '#title' => t('Date From'),
    '#type' => 'date',
);

$form['date_to'] = array(
    '#title' => t('Date To'),
    '#type' => 'date',
);

Which displays on the page as:

And creates the select element values (without zero padding):


texts: How do I change the structure of node's $content variable?

texts:
I create a Content Type and I add to it a field (Embedded Media Field) that has thumbnails of Youtube videos.

Now the thumbnails use each a row on its own. I want to make them show in three columns, like in a grid. I understand i have to create a node-MyContentType.tpl.php . But in this file there is a $content variable that holds the html structure of the content and i can't find a way to change that (i want to remove some divs). Can anyone guide what to search for?


texts:
I have a site running with these modules (among others):

Pathauto
Transliteration

My problem comes with danish characters. Normally they would be replaced like this:

Æ = Ae
æ = ae
Ø = Oe
ø = oe
Å = Aa
å = aa

However, the Transliteration module isn't working like I would expect; it replaces:

Æ = ae
æ = ae (correct)
Ø = o
ø = o
Å = a
å = a

So "ÆØÅ - æøå" becomes "aeoa-aeoa".

The "lower case issue" might be caused by the Pathauto module, and it is not neccesarily a problem with the transliteration. Still it's not correctly replaced.

This is a file from the Transliteration module that I think it does the replacement of Danish characters, but I can't figure out how to make it work correctly.

x00.php

<?php

$base = array(
  // Note: to save memory plain ASCII mappings have been left out.
  0x80 => '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  0x90 => '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
  0xA0 => ' ', '!', 'C/', 'PS', '$?', 'Y=', '|', 'SS', '"', '(c)', 'a', '<<', '!', '', '(r)', '-',
  0xB0 => 'deg', '+-', '2', '3', '\'', 'u', 'P', '*', ',', '1', 'o', '>>', '1/4', '1/2', '3/4', '?',
  0xC0 => 'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
  0xD0 => 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'x', 'O', 'U', 'U', 'U', 'U', 'U', 'Th', 'ss',
  0xE0 => 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i',
  0xF0 => 'd', 'n', 'o', 'o', 'o', 'o', 'o', '/', 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y',
);

// Overrides for Danish input.
$variant['da'] = array(
  0xC5 => 'Aa',
  0xD8 => 'Oe',
  0xE5 => 'aa',
  0xF8 => 'oe',
);

// Overrides for German input.
$variant['de'] = array(
  0xC4 => 'Ae',
  0xD6 => 'Oe',
  0xDC => 'Ue',
  0xE4 => 'ae',
  0xF6 => 'oe',
  0xFC => 'ue',
  0xDF => 'ss',
);

SOLUTION

When developing I had the language set to English; it needs to be set to Danish, in order to get this to work.


texts: Views PHP: Getting field values and generating link

texts:
I want to generate the RSS feed of my calendar as:

PHOTO (uploaded photo)

BODY

http:://www.example.com/content/the-title (Link of feed to the content page)

For this I use a "Global: PHP" field in the calendar view I created, entering code in "Output code".

I didn't succeed in printing the node body using:

<?php echo $row->body; ?>

With this, I get the ID.

The following gives no result:

<?php
$node = node_load($row->nid);
print_r($node);
?>

Using:

<?php print_r($row); ?>

I got:

stdClass Object
(
[title] => The title
[body] => 1311
[rendered_entity] => 1311
[php] =>
)

How to I get the real content of the body, image link (field_photo) and the content link?

Thanks,


texts:
I've to get the taxonomy_term tid from the alias ('/alias/of/my/term')

Is there a way to do this without making a query on url_alias table?


texts: Is there a drupal 7 module for webform password and password confirmation fields?

texts:
Is there any module that I can use for password and password verification field on webform.

I googled the sites and apparently the webform_password module is for drupal 6 only.

Thanking you in advance


texts: How to show main menu links based on user roles?

texts:
I am showing menu items and I want to show some links to Anonymous user only and some links to Authenticate user.

It it possible to accomplish this in Drupal 7? If so how?


texts: Migrating user names with accent causes integrity constraint violation

texts:
I'm migrating users from a Drupal 6 to a Drupal 8 site. I use the original d6_user source plugin provided by the User module, so nothing really specific about that part.

I'm experiencing many integrity constraint violation errors with messages similar to the following.

  1062 Duplicate entry 'Saïd-fr' for key 'user__name' trying to insert datas in users_field_data table. user__name is a unique key composed of name and langcode field.

Investigating a bit more, I found the original Drupal 6 site user data had another name entry of value "Said" for the same language (since both sites are monolingual). Checking users table definition shows the collation is utf8mb4_general_ci. As explained here the ci suffix means case insensitive, which means for example I, i or even ï are considered the same by MySQL when comparing strings, which  leads to the duplicate entry error. For the record, the Drupal 6 users table from which the name field comes from has the latin1_general_ci collation. Although it is 'ci' suffixed, it obviously authorizes this kind of duplicate.

This lack of compatibility between Drupal 6 and Drupal 8 database schema is for me a problem, since I'm unable to migrate approximately 800 user accounts. I've changed this specific field to utf8_bin collation and it seems to correct the issue.

Do you think it's a good solution? Is the utf8_bin the best collation for that purpose? Can it lead to problem in the future to change the Drupal 8 database schema?


texts:
In my content type I have two multi values fields for images and embedded videos. Those fields are displayed in view.

I wanted to display elements of these fields in carousel. I found solution on google, but this solution only works when I have more than one items in field.

I didn't manage to do it for one element in the field.

I want to display those fields (no matter if field has one or more items) in html list.

Could somebody give me any advice?

[EDIT]

I try similar solution to @Shoaib Nawaz answers, but because of memory problems I can display values only from $row object.

The part with data of embedded videos look like this:

   [node_data_field_video_field_video_embed] => Array
        (
            [0] => Array
                (
                    [embed] => http://www.youtube.com/watch?v=XnflHoDIwFk
                    [value] => XnflHoDIwFk
                    [provider] => youtube
                    [data] => a:6:{s:20:"emvideo_data_version";i:5;s:23:"emvideo_youtube_version";i:5;s:8:"duration";i:831;s:8:"playlist";i:0;s:9:"thumbnail";a:1:{s:3:"url";s:43:"http://img.youtube.com/vi/XnflHoDIwFk/0.jpg";}s:5:"flash";a:3:{s:3:"url";s:32:"http://youtube.com/v/XnflHoDIwFk";s:4:"size";s:4:"1011";s:4:"mime";s:29:"application/x-shockwave-flash";}}
                    [status] => 1
                    [version] => 5
                    [title] =>
                    [description] =>
                    [duration] => 831
                )

The part of images looks like:

[node_data_field_photos_field_photos_fid] => Array
        (
            [0] => Array
                (
                    [fid] => 18515
                    [list] => 1
                    [data] => a:2:{s:3:"alt";s:30:"System stołów automatycznych";s:5:"title";s:0:"";}
                )

Screen with jcarousel with this stuff (worked only for fields with more than one items):

Now I need to find function to turn this data to html or code it all.


texts: Looking for a theme recommendation for flexible content region?

texts:
I am looking for a theme whose content region automatically expands to fill the sidebar regions when those shrink. ie the content region and sidebars must be in the same container with the content region designed to expand to fill the sidebar regions when those shrink. It is mainly to free the space taken up by the elements and menu in the sidebar when during editing content I don't need them, but call them out when I do. It should be a theme without wasted space and designed to use all the screen area.
I want to use the JQuery slide toggle system to expand the side bars when I need them,and shrink them when I don't.

e.g. I currently have Admin doing something similar but it shifts the whole page and has its own menu style. I want the header and footer areas intact and just the content area expanded and contracted as required.

I just want to load up Firebug and adjust the sidebar widths and if the content region expands or contracts to fill the space or shrinks I'll be happy to apply my JQuery.


texts: How can I get the active menu trail for the current page?

texts:
If I use Drupal::menuTree() to load a menu it seems to always have inActiveTrail set to FALSE for all my items.

As an example consider the following code:

$menu_tree = Drupal::menuTree();
$parameters = new MenuTreeParameters();
$parameters->setTopLevelOnly();
$main_menu_top_level = $menu_tree->load('main', $parameters);

That code returns the top level of the main menu with inActiveTrail = FALSE for all items regardless of what page I am on.

I believe MenuTreeParameters::setActiveTrail() is meant to help here but then I have to pass in an active trail.

How do I get the active menu trail for the current page load so I can then pass it in?


texts: Limit the number of discount per product to 1, Commerce Discount

texts:
I'm trying to make a one time discount for each product of a certain type per customer.
If the user buy a product he will have a discount on it, but he cannot have it a second time.

How can I do that.

So far I couldn't figure out how to limit it for the product itself.
Maximum usage determines how many times a discount may be applied across all customers or to a single customer's orders, which in my case should be empty (unlimited).

Where is the setting to limit the number of use per product to 1?

Is it a rule I need to code?

Cheers


texts:
We're currently using Aegir to manage sites, essentially, domains and sub domains. However, we have a need for sub sites. For e.g., domain.com would the parent, and the children sites would be domain.com/division1, domain.com/division2 and so. The databases could be the shared or not; themes could have a parent-child relationship or not. Looks like this is not in Aegir yet (although the university crowds are asking for it)

What options exists to create and manage sub sites using Drupal? How do folks typically do this? I looked at the subsite module, while looks like it is still in dev for D7.

Many thanks!


texts: Force a page to be rendered in admin theme (overlay mode)

texts: Is there a way to force a page to be rendered in admin theme, Like pages that their path begins with 'admin/'?


texts:
I have a content type called events (obviously it keeps a list of events (conferences, meetings, etc).

I have a views-view--events-list.tpl.php file where I render a list of events.  All of this is working perfectly.

What I need to do is sort events differently based on the event date.  In specific, events that have passed (earlier than today's date), should be sorted descending - that is the most recent past event first and the event that is furthest back in history should be shown last.

For events that are still pending (in the future), the sort order is exactly the opposite - the event that will happen next should be first in the list and the event that is furthest in the future, should be shown last.

For example (assume today is 1/4/2016)

event 4: 5 April 2016 (future, the next date we will encounter)
event 6: 15 May 2016
event 5: 25 Dec 2016 (future, the last future event we will encounter)
event 1: 25 Feb 2016 (past, this was the most recent past event)
event 3: 2 Jan 2016
event 2: 24 Dec 2015 (past, this is the furthest past event)

I need to do this in one view (I do not want to create two views in code with different date ranges and sort orders; I know how to do that - I am trying to do it using just a clever sort order and the default views-view--events.tpl.php) template file.

My question then - how do I create different sort orders for different nodes (based on a field value such as date) in one view?  Is this even possible?


texts: How do I get fields attached to a user to display to anonymous viewers?

texts:
I've searched around and either I don't find any questions that address my issue per se, or the solutions offered don't pertain/affect my problem. So here goes:

A D7 site, current core, etc.

I have fields attached to user entities. I don't have any permissions applied to limit access to the fields. All users (including anon) have access to user pages (user/username).

However, attached fields do not appear through views for anonymous users. They do appear for logged in users, and anonymous users can see the Groups Audience (I use organic groups on the site), but no other affiliated data shows (full name, website, twitter, etc).

If my view is a list of fields, the fields do appear, but without content (the labels print if I turn them on, text I have set to display as no results behavior shows, etc). If my view returns a rendered entity all that prints for anonymous users is the user picture and Groups Audience.

I'm at a loss here. Initially I thought it was a views issues; now I'm not so sure. I've checked my permissions multiple times and I can't see what's blocking it. Anonymous users can access user pages. I don't have any field-level restrictions (and enabled the Field Permissions module just to make sure). I don't know what else it could be.

Any help is super appreciated.


texts: Commerce Kickstart 2 Admin Functions Extremely Slow Shared Hosting

texts:
I'm having a problem similar to some others posted here: Extremely slow performance in Admin for certain operations, most notably: Adding an Order or saving a View. Basically, it -feels- like SQL Queries that -insert- more complex kinds of data cause issues.

Unlike other posts I've read, I'm on shared Linux hosting.

The odd thing is that we have a production site on (Ubercart) on D6 which is on the same physical server, but is -not- having issues like this at all.

I have contacted the hosting company and they assure me that the MySQL and PHP settings are the same for both the D7 (slow) site and the D6 (fast) site.

What are my options for troubleshooting this?
Is this a known problem specific to Commerce and/or D7?

Just to be clear: The visitor face of the site works fine. For example, if I add an order from the actual site, it works as expected. The same operation from the Admin might take 30 seconds.

TIA.


texts: Provide contents of file field at node URL

texts:
I'm trying to set up my Drupal website to host files (more specifically, PDFs) at clean URL's and have some download statistics about them. For example, I would like "test.pdf" to be available at "/publications/test.pdf". I read about all the file managers such as IMCE, but they do not seem to provide this feature. Therefore I'm now trying to set up a Publication content type with just a single field of type File, use the URL path settings to get the clean URL and use the Download Count module to provide me some download statistics. However, I cannot seem to have Drupal return the PDF in the file field when a user visits the URL of such a node. The closest I get is rendering a link to the file, using the display settings of the file field.

Is this the way to go for what I want to achieve? And if so, how can I provide the contents of a file field at the URL of the node containing that field?

Thanks in advance.


texts: how to get individual classes for each menu list items

texts:
I am theming my website and used the following code to print my main menu.

<?php
 $main_menu = variable_get('menu_main_links_source', 'main-menu');
 $tree = menu_tree($main_menu);
 print render($tree);
?>

Now, I need to have individual class name of each list item, so that I can call different background images using css. I would like to have class with name 'menu-497' as shown in screenshot. I couldn't figure out how this is done. Please help.
Old code which used to load individual list class is below. But this code won't load submenu, so I am not using it.

<?php print theme('links__system_main_menu', array(
  'links' => $main_menu,
  'attributes' => array(
    'id' => 'topNav',
  ),
)); ?>


texts: Contextual filter on taxonomy view using URL

texts:
I have a taxonomy

Bubble
Clouds
Flower

I also have a pages where I need to be able to pull a taxonomy term (and it's fields) into the page.
if the site path is abc.com/features/bubbles

I need to be able to access blubbles and it's fields.

I've created a view of taxonomy terms that lists all my terms.   I can not get the contextual filter correct to display just bubbles.

Any help is appreciated.


texts:
I try to install open social using drush-8.3.0 and drupal-8.7.5. The first step is to run composer create-project goalgorilla/social_template:dev-master public_html/peer/opensocial --no-interaction. that works fine. The next step is drush -y site-install social --db-url=mysql://root:root@db:3306/social and results in the following error:

Drush\Sql\SqlException: Unable to find a matching SQL Class. Drush cannot find your database connection details. in phar:///home/username/bin/drush/drush/commands/sql/sql.drush.inc:554

Using MySQL Wizerd and MySQL admin I have created the social database and defined username, password and ip address in drush -y site-install social --db-url=mysql db_username db_password://root:root@IP address:3306/social.
I have no ida how to find out what is realy going on? I am on a linux shared server. Can anybody help? Here is stack trace:

#0 phar:///home/username/bin/drush/drush/commands/sql/sql.drush.inc(539): drush_sql_get_class(Array)
#1 phar:///home/username/bin/drush/drush/commands/core/site_install.drush.inc(124): drush_sql_get_class()
#2 phar:///home/username/bin/drush/drush/includes/command.inc(422): drush_core_pre_site_install('social', '://root:root@10...')
#3 phar:///home/username/bin/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#4 phar:///home/username/bin/drush/drush/includes/command.inc(199): drush_command('social', '://root:root@10...')
#5 phar:///home/username/bin/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#6 phar:///home/username/bin/drush/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#7 phar:///home/username/bin/drush/drush/includes/startup.inc(465): drush_main()
#8 phar:///home/username/bin/drush/drush/includes/startup.inc(369): drush_run_main(false, '/', 'Phar detected. ...')
#9 phar:///home/username/bin/drush/drush/drush(114): drush_startup(Array)
#10 /home/username/bin/drush/drush(10): require('phar:///home/oi...')
#11 {main}

when I run drush @hpc.dev sql-conf I get this:

Scanning into /home/username/public_html/peer/opensocial/html/sites/default for /hpc.dev.alias.drush(8|)rc.php$/ [0.33 sec, 7.29 MB]                                                                                [debug] Could not find the alias @hpc.dev [0.33 sec, 7.29 MB]


texts: How to add title of the image in manage display section or display it in node view page

texts:
I want to display title property of an image in node view page.
How can I display title of an image along with image in node page?


texts: Given $form, how to programmatically generate its corresponding $form_state?

texts:
The media_mover module contains this function, which builds a form and pre-populates default values:

/* step 1 */ $form = media_mover_api_configuration_base_form($configuration);

It also contains this function, which submits the form:

/* step 2 */ function media_mover_api_add_config_form_submit($form, &$form_state)

I would like to programmatically generate the form (step 1), and then programmatically submit the form (step 2).
Step 1 is not a problem; I am able to generate $form.  For step 2, I need $form_state.

Given $form, is there a way to programmatically generate its corresponding $form_state?  I am using Drupal 6.

This is a more detailed explanation of what I am trying to accomplish.
I am able to programmatically fill out and submit a particular form by laboriously setting all the field values in $form_state['values'], and then calling media_mover_api_add_config_form_submit($form, &$form_state);

However, the process would be  much simpler if I could instead use this function, which converts a $configuration object into $form, and does all the heavy lifting:

$form = media_mover_api_configuration_base_form($configuration);

This function enters a default value into each form field.
The only missing step, then, is to copy all these default field values from $form to $form_state['values']. I am wondering whether there is a function to do this.  Or is there a way to loop through all the fields in $form and extract the field-name and default value?


texts: Webform get all submission for a node by date

texts:
I am using webform_get_submissions to get all submissions, I have a requirements to get only one day back submissions.

Is there any way to get this results?


texts: How to delete a path when uninstall a module?

texts:
this is for Drupal 8:

in my hook_install function, i have following code:

MenuLinkContent::create([
        'title' => 'Location',
        'link' => ['uri' => 'route:locator.filters'],
        'menu_name' => 'main',
    ])->save();

when I have uninstalled my module, how do remove above defined link?


texts: How to view several Colorbox images simultaneously after click on wide screen?

texts:
Usually I see only one big overlay image after click thumbnail with Colorbox.

Is there Colorbox settings to view several overlay images simultaneously on wide screen after click?


texts: How can I change the labels on a chart created with the Google Chart Tools module?

texts:
I'm using both the Chart module and the Google Chart Tools module to create a chart from  the data that I'm collecting from registered users.

Here is a sample of my chart:

But how can I change the labels of the X-axis?

And I want the title to appear on the X-axis also, instead of the link. How can I do that?


texts: How to enable user registration, but don't allow any of those users to login?

texts:
I want to use the user registration page to collect user data and use its email verification checking to filter out fake users. But the thing is I don't want these users to be able to login to the site. How can this be done in Drupal 7?

Note: So no login at all. I just want to use the registration system to send them an email to verify their account.


texts:
I have a product display node and I'm trying to add a rental form to the node so that anyone can submit a rental form and have that reference the node. I was thinking of making the rental form a new Content Type so that the author information is automatically stored. I was also looking at Entityforms and specifically Inline EntityForms since that seems to incorporate the entityreference field.

Approach 1

What's interesting about the Inline Entityform is that you don't need an Entityform type to use it. You can select the Target type as 'node' and have that create a node form within the parent node's edit page.

The problem I'm facing with this approach is that you can't render the form on the front-end. I've tried setting the Display settings to 'Rendered entity' and I'm still not seeing anything on the front-end of the parent node, logged in as admin.

Is the Inline Entityform module only for embedding node add forms to the back-end?

Approach 2

The second approach was using Inline Entityform to target a node of type 'Rental' with the same settings but I was still unable to produce a node add form on the parent node front-end.

I do not want to use Panels but it's looking like I might have to? Any thoughts are appreciated.


texts: I want to know how to enable view programmatically in drupal 7? I need it to be exportable with features. I need a snippet code for that. Thanks!


texts: EntityFieldQueryException when saving node

texts:
I have created a node type which I want to use to store events in. I can create new nodes of this type with no problems, but when I want to edit and save a existing node, I get this error:

In english, this means "Unknown field:". However, a field with this name isn't even defined in my node type:

Full size image here: http://d.pr/i/8V36

Do you have any idea what could cause this error?


texts: Access denied when using webform submissions email link

texts:
Interim admin here- no experience- just trying to keep the wheels turning until a new hire made. Drupal 7.43.

Site has "contact us" form implemented as a webform, with email notification to certain addresses, who get email of the form:

  Submitted on Monday, July 18, 2016 - 4:48pm Submitted by anonymous user: IP.IP.IP.IP Submitted values are: Full Name Test2 Email test2@example.com Message This is an example The results of this submission may be viewed at: http://thenameofthesite.com/node/XXXXX/submission/YYYYY

where XXX and YYY are ids.

Users receiving the email complaining that clicking on the link gives a page on the site
with:

  Access denied
  You are not authorized to access this page.

In the admin for the Webform contact form, under Access control, anonymous user is checked for both "View any webform content" and "View own Webform content".

Users are claiming this worked before, and I don't have the experience to gainsay them. Any suggestions on what else I can try?


texts:
What is the correct way to overwrite the Omega theme stylesheet, so that the margin of .grid-1 is 0 instead of 10px?

I tried to specify this style:

.grid-1 {
  margin-left: 0;
  margin-right: 0;
}

in two stylesheets:
/sites/all/themes/mytheme/css/mytheme-alpha-default-normal.css -> this one is not loaded at all

/sites/all/themes/mytheme/css/global.css -> this one is overwritten by alpha-default-normal-12.css

The alpha-default-normal-12.css is always at the top of all loaded stylesheets, so it looks like it can't be overwritten. And it contains the styles for all .grid-x margins.

So, how to specify my own margin for a grid?


texts: create url with destination parameter and additional query string to views page with exposed filters

texts:
I have a views page with several exposed filters.
I have created a link using a view php field as per below:

$url = '/admin/dashboard/applications/create/' . $row->nid . '?destination=' . current_path() . '&' . $_SERVER['QUERY_STRING'];
$link = 'App+';

This leads to a form page with a confirmation 'Submit' or 'Cancel' button.  The resulting URL on that page being something like this:

http://www.site.com/admin/dashboard/applications/create/154575?destination=admin/dashboard/enquiries&nid=&field_enquiry_fname_value=&field_enquiry_email_value=&field_enquiry_country_tid=&field_enquiry_campaign_id_value=&field_enquiry_emailed_value=0&field_enquiry_stage_1_tid=All&field_enquiry_enabled_value=1

When the redirect is done, the querystring after ?destination=admin/dashboard/enquiries is removed. I think this happens because it is not URL encoded.

I then tried url encoding the link as per below:

$query_string = array('destination' => current_path() . '&' . $_SERVER['QUERY_STRING']);
$url = url('admin/dashboard/applications/create/' . $row->nid, array('query' => $query_string));
$link = 'App+';

This creates the following url:

http://www.site.com/admin/dashboard/applications/create/154575?destination=admin/dashboard/enquiries%26nid%3D%26field_enquiry_fname_value%3D%26field_enquiry_email_value%3D%26field_enquiry_country_tid%3D%26field_enquiry_campaign_id_value%3D%26field_enquiry_emailed_value%3D0%26field_enquiry_stage_1_tid%3DAll%26field_enquiry_enabled_value%3D1

The issue now is that when the redirect is done back to the views page, views does not recognize the URL query and does not load the view, and falls back to the parent menu callback.


texts:
I installed openatrium locally on Wampserver2.4, after installing all the 186 modules, I goes to site home page, but it show following error

how to cope this error


texts:
I've been struggling with this for a few days. I currently have a form which I am creating and rendering through Drupal 8's Form API. I am saving the inputted field values using Node::create() which has been working great. I am now using the Tablefield module for some of the fields. I am struggling to save this data as part of the Node::create() function however. I am reasonably new to Form API so I'm sure I'm missing something obvious.

My current Node::create() is a little like this

$node = Node::create([
      'type'                      => 'business',
      'status'                    => 1,
      'field_membership_type'     => $form_state->getValue('type_of_membership'),
      'field_type_of_business'    => $form_state->getValue('membersInTheQuarter_type'),
      'field_business_size'       => $form_state->getValue('businessSize_antique'),
      'field_business_size_shop_' => $form_state->getValue('businessSize_independentShops'),
      'field_category'            => $form_state->getValue('businessCategory'),
      'field_additional_category' => $form_state->getValue('additionalBusinessCategory'),
      'field_category_custom_'    => $form_state->getValue('businessCategoryCustom'),
      'title'                     => $form_state->getValue('business_name'),
      'field_tag_line'            => $form_state->getValue('tag_line'),
      'field_about'               => $form_state->getValue('about'),
      'field_opening_hours'       => /**This is where I need to access the individual cells of tablefield to set values from my form**/
    ]);

  $node->save();


texts: How to define the time-range for the Time Field in Webform 4.x

texts:
is it possible to change the selectable time range in a time-field in Webform? I don't want the users to have the choice to select between 00:00 and 23:59. I only want them to choose between 15:00 and 23:00.

Webform validation doesn't work on time fields. Is there any other way?

Thanks in advance.


texts:
I'm looking for a way to add the noscript tag after every  tag. Even the file tags. I cannot have alternatives as the client I'm doing this for has made this mandatory for 508 purposes. I believe the software they are using is failing the 508 scan because of this.

Example below.

Your browser does not support Javascript

Your browser does not support Javascript


texts:
When a user pushes a button element marked with ajax, I would like the callback to modify the button value (text shown on button), and have it updated both in the browser and the form state. Updating in the browser is easy by return an ajax_command_replace call. But I'm not having any luck with getting the form updated to remember the updated button value the next time the button gets pushed.

It seems the way the ajax form is built, that the initial value of the button gets hardcoded where the callback function in the javascript page gets defined, which probably explains why the button element returned to the ajax callback does not match with the value it shows in the browser (after I changed it with the ajax_command_replace).

But I can live with that, as long as I can get the form (or form_state) to actually remember the new value of the button element from a previous invocation of the callback.

I've also tried modifying the form/form_state values in the form validate hook, but without success.

So, despite already knowing this does not work, the following code tries to illustrate what I'm trying to do:

function testajax_callback($form, &$form_state) {
  $form['mybtn']['#value'] = 'New value';
  return array(
    '#type' => 'ajax',
    '#commands' => array(
      ajax_command_replace('#mybtnwrapper' => drupal_render($form['mybtn']))
  );
}

Any help on how to do this the Drupal 7 way would be appreciated.

update 1:

Got a hint on the Drupal Forums. The following code is probably more according to Drupal 7 design and style:

function betapp_testajax_callback($form, &$form_state) {
  $form['mybtn']['#value'] = 'New value';
  return $form['mybtn'];
}

function betapp_testajax_form($form, &$form_state) {
  $form['mybtn'] = array(
    '#type' => 'button',
    '#id' => 'mybtn',
    '#prefix' => '',
    '#suffix' => '',
    '#default_value' => 'Default value',
    '#ajax' => array(
      'callback' => 'betapp_testajax_callback',
      'wrapper' => 'testajaxwrapper',
      'method' => 'replace',
      'effect' => 'fade'
    )
  );
  return $form;
}

The code manages to change to appearance of the button (button value), but when pressing the button with the updated value, the old one is still the one sent, so effectively, no values in the form has changed, only the button appearance.

It may have something to do with hardcoded values in the callback definitions in the html page (which is only loaded once). I find entries such as these:

{"callback":"betapp_testajax_callback","wrapper":"testajaxwrapper","method":"replaceWith","effect":"fade","event":"mousedown","keypress":true,"url":"\/d7\/system\/ajax","submit":{"_triggering_element_name":"op","_triggering_element_value":"Default value"}}

If _triggering_element_value is used regardless of the actual value of the element, that explains why the new value is not picked up. Maybe the _triggering_element_value should be looked up at runtime when the callback gets activated?

Any ideas on workarounds/fixes?


texts: How can I create two distinct sets of exposed filters for use in a single view?

texts: I am wondering if there is a way to create two distinct sets of exposed filters to use on a single view. The reasoning is that I have a view for content of a given type. I have a set of views exposed filters placed in the header of the site that is used as a search form, which displays its results within this view. However, once the user submits a search, I would like them to be able to further filter their results based on aspects of the resulting nodes. This would somehow require a second set of exposed filters for the same view. As far as I can tell, as long as I have my exposed filters in a block, all filters that I add are placed within that block. Is there some way to get around this, and display two sets of filters, in different places, for a single view?