texts: Alter menu title or add menu item programmatically?

texts:
I want to create link to user from the menu created by UI. I tried with hook_menu but the link is 'user', but it doesn't work, because don't want to create new page. I would like to alter title or add menu item programmicaly to use First name in the the menu title.

What i know is the 'mlid' = '3228' and menu name is 'menu-user-links-top'

PS. I also tried with hook_menu_link_alter but it doesn't work, for all users (the first name appears after pressing edit menu and uses only admin's first name).


texts:
I am following the instructions to install Drush that are listed on this page: https://github.com/drush-ops/drush/blob/master/docs/install.md

I seem to be getting a syntax error within the code:

[user@localhost ~]$ wget https://github.com/drush-ops/drush/releases/download/8.0.0-rc4/drush.phar
--2015-11-16 16:23:02--  https://github.com/drush-ops/drush/releases/download/8.0.0-rc4/drush.phar
Resolving github.com (github.com)... 192.30.252.131
Connecting to github.com (github.com)|192.30.252.131|:443... connected.
HTTP request sent, awaiting response... 302 Found
2015-11-16 16:23:05 (1.47 MB/s) - drush.phar saved [3496991/3496991]

[user@localhost ~]$ php drush.phar core-status

Parse error: syntax error, unexpected '[' in phar:///home/user/drush.phar/includes/output.inc on line 188

I am not seeing this error on Google. Any idea how to fix it?


texts: Calender module not working with cck date field

texts:
I have installed calendar module and create a view with display style calender. I want to display the contents in calender on the basis of a cck date field.

I have created a view and added cck field as argument and add the same field in field section. But in calender display there is no content is displaying.

If I add node post date field instead of cck field then calender is working properly. Is there any special settings required for cck field work with calender module? Any help appreciated.

This is my views settings:

Argument Settings:


texts: Drush says it needs Composer, but Composer is already installed?

texts:
I've recently re-provisioned my development box, and went to run a drush command but was met with

  Unable to load autoload.php. Drush now requires Composer in order to install its dependencies and autoload classes. Please see README.md

I then tested to see if Composer was installed and found it was (version 1.0.3).

Would anyone know what I can do here?


texts: Inline javascript in drupal_add_js is causing WSOD

texts:
In my template.php i am executing some inline javascript code. When executing, the result is a white screen of death (WSOD). The web servers error log says:

  PHP Parse error:  syntax error, unexpected '(', expecting T_VARIABLE
  or '$' in /template.php on line 89.

Line 89 is this one:

  drupal_add_js("(function ($) {$('.altona_1').hover(function() {

And here comes my whole template.php:

<?php
function skh_omega_preprocess_page(&$vars, $hook) {
  drupal_add_library('system', 'ui.accordion');
  drupal_add_js("(function ($) {$('.altona_1').hover(function() {
    $( '.field-collection-container' ).accordion( {
      header: 'h4',
      active: 2,
      collapsible: true
      } );
    },
    function() {
    $( '.field-collection-container' ).accordion( {
      active: false,
      collapsible: true
    } );
  });
 })(jQuery);", array('type' => 'inline', 'scope' => 'footer'));
}

Do i have a wrong markup or what's the matter?


texts:
There are many different git workflow branching models proposed. While I try to determine the best one for my project, I want to know what the Drupal.org community uses for Drupal Core development.

I'm curious, with respect to master, dev, release, feature, version tags, etc.

I know there are several questions here about Drupal Git workflow in general, but I'm specifically wondering what Drupal.org does for branching. Thanks!


texts:
Is there a difference in weight (performance wise) in using custom eck entity bundles or nodes?

So if I need to store data bundles with the following values(fields):

Entity Reference to other node nr 1.
Entity Reference to other node nr 2.
Boolean

Now when there will be more than 100.000 of these data bundles is there any difference in performance when using the core nodes or a custom eck entity bundle when for example using views to this information or when I use search to go through the data?


texts: Using Cloudflare SSL: Getting mixed content errors

texts:
Because my site is an eCommerce site, and because the browsers are reporting sites with any http links as not secure to the user, I signed up for the free Cloudflare SSL.  However, I got a lot of mixed content errors and had to go into all my content and blocks and change the link code to a relative location link or https.

but I still have these mixed content errors for style sheets that are getting imported or called in the Drupal or Theme code.  I cannot find where I could change these links.  Here are a few:

  Mixed Content: The page at 'https://dm-treasures.biz/' was loaded over HTTPS, but requested an insecure stylesheet 'http://dm-treasures.biz/modules/system/system.base.css?oyx30a'. This content should also be served over HTTPS.
  Mixed Content: The page at 'https://dm-treasures.biz/' was loaded over HTTPS, but requested an insecure stylesheet 'http://dm-treasures.biz/modules/system/system.menus.css?oyx30a'. This content should also be served over HTTPS.

I've tried using a couple of Drupal modules (Htaccess and SecurePages), and setting the Cloudflare "Always use HTTPS" setting, but I'm not able to fix this problem. I am using Drupal 7.x and my hosting service is BlueHost.

Given the above configuration and problem statement, what can I do to prevent my site for getting mixed content errors?

Thanks,
Dave


texts: I am looking for a friend's list  for the Organic Groups module

texts:
I'm looking for a friend's list (kind of Google+ circles functionality) to work with the Organic Groups module.

I wish to allow users to add tags to users that are their friends, e.g. work or family, and then use these tags for activities like share, privacy, or mailing list.

I didn't find any, but the closest modules are:

Relationships; it is public to other users and has to be confirmed by the other user.
User roles; it is set by the admin
Mail lists; I didn't find any that tag/manage contacts by tags or lists. The Lists module doesn't work well.


texts: Theme developer module crashes the whole site when enabled, how to fix?

texts:
I'm working on a clean Drupal 7.x installation, downloaded Theme developer and its dependent module simplehtmldom API( another required module for Theme developer) using drush.

I found out that simplehtmldom 7.x-2.x is incompatible; so I removed it, and  Installed  the 7.x-1.12 version using Drush, enabled it, enabled the Theme developer module was available to be enabled. Now the site doesn't work anymore.

All I'm seeing is just some tags like this.

< /> < /> < /> < /> < /> < /> < /> < /> < /> < />

The problem is fixed when I disable the Theme developer module manually with Drush; everything gets back to normal, when I disabled that module.

I've tried to navigate the site using /node/1 and tried to go to the administration panel; all I noticed is that the title of the page (the one appearing on the browser's tab) appears but the content seems to be the same.

How do I solve this issue?

This is a screenshot.


texts: jQuery slideshow behaving oddly in Drupal

texts:
I have a jQuery slideshow that worked fine when it was running in a site built with standalone PHP files, but now that I've rebuilt the site in Drupal, it has a problem. The slideshow is running in the header of this page:

http://oaklandoctopus.org

There are five images in the slideshow, the first of which is selected randomly. The first time the script loops back to the beginning, the first image does not appear. Then, on subsequent loops, everything is fine. Here is the jQuery script:

var x = Math.floor(Math.random() * $(".home-page-header-images .view-content .header-slideshow-image").length);
$(".home-page-header-images .view-content .header-slideshow-image:eq(" + x + ")").addClass("active").css({opacity: 1.0});

    setInterval(homepageSlideshow, 4000);

    function homepageSlideshow() {
        var activeImg = $(".header-slideshow-image.active");
        var nextImg = activeImg.next(".header-slideshow-image");
        console.log($(".header-slideshow-image:first"));
        if (nextImg.length == 0) {
            nextImg = $(".header-slideshow-image:first");
            }
        nextImg.addClass("next").animate({opacity: 1.0}, 1000, function() {
            activeImg.removeClass("active").css({opacity: 0.0});
            nextImg.removeClass("next").addClass("active");
        });
    }

Here is the relevant CSS:

.home-page-header-images .header-slideshow-image, #footer-slideshow .header-slideshow-image {
opacity: 0;
position: absolute;
z-index: 0;
/* Early IE */
filter: alpha(opacity=0);
}

.home-page-header-images .header-slideshow-image.active, #footer-slideshow .header-slideshow-image.active {
z-index: 1;
display: block;
}

.home-page-header-images .header-slideshow-image.next, #footer-slideshow .header-slideshow-image.next {
z-index: 2;
display: block;
}

I am so thoroughly stumped its not even funny. Any help is greatly appreciated. Happy to provide any additional information. I'm relatively new to Drupal theme development, just FYI.


texts:
I've just activated the Forum module and installed Advanced Forum. My 3 forums and 2 containers work when I browse straight to the forums and containers. The main list doesn't work though. When I go to /forum I get a SQL Error

  General Error
  SQL ERROR [ mysqli ]

  Access denied for user 'username'@'hostname.com' (using password: YES) [1045]

  An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

Isn't the main forum page supposed to list all the containers and forums like this http://drupal.org/forum? Do I have to enable anything or make a main container to make it do that?


texts: Subtotal calculates from original product price, disregards applied per product discounts

texts:
This seems like a known issue but I actually didn't find a solution for this anywhere.

In commerce, if I apply a discount/pricing rule to a certain product, add it to cart, and go to checkout, table would say eg

Product - 120$ (discounted from original 200$)
Subtotal - 200$

The subtotal is taken from the original product price and doesn't include the applied discount. It would be a lesser problem if that was just display issue. But the tax is then actually calculated from the subtotal, making the order total wrong

Is there a solution for that?


texts: Return both a form and content in a menu callback

texts:
I have the following code.

function mymodule_menu() {
  $items = array();

  $items['mymodules/page'] = array(
    'title' => t('my module settings'),
    'description' => t('change values here'),
    'page callback' => 'mymodule_page',
    //'page arguments' => array('mymodule_page'),
    'access arguments' => array('access administration pages'),
    'type' => MENU_CALLBACK,
   );

  return $items;
}

function mymodule_page() {
  return drupal_get_form('test_form');
}

function test_form() {
  $form = array();
  $brandarray = array('nokia','siemes');

  $form['mymodule_brand'] = array(
    '#type' => 'select',
    '#title' => t('Brand'),
    '#default_value' => variable_get('mymodule_brand', 'nokia'),
    '#options' => $brandarray,
    '#description' => t('Change this.'),
  );

  $form['my_markup'] = array(
  '#markup' => '
Lorem ipsum
',
  );

  return system_settings_form($form);
}

This works perfectly. What I wanted to so is returning a form and page content together, i.e after the page content, in a menu callback function; I tried using the following code:

function mymodule_page() {
  $variable =  drupal_get_form('test_form');
  $variable .= '
here
';

  return $variable;
}

But it prints something like the following:

    Array
    here

How do I return both the form and content together in a menu callback?


texts:
I just upgraded to Drupal 7 from Drupal 6. It appears I've finally gotten everything working, except the module updater isn't working; it can't update from a URL or a file. I also cannot install new modules.

I check the box next to the module to update and it appears that it's working, or downloading; it works for a few seconds, then it just reloads the updater page and nothing has changed. It is the same when I install a new module, entering the URL for the module, or choosing the file from my computer. Again, it appears to be working, but it just reloads the module install page.


texts: Should I use the Workbench Access module to implement the workflow we have in mind?

texts:
I am new to Drupal altogether and have a question about a site i was asked to work on. We think that Workbench Access will solve our problem but we have not yet figured out how to make it work the way we want.

I have a large site and I have the users setup, and Roles setup, etc. But what I want to do is let users edit submit edits (for approval) on only one portion of the site (the staff portion to edit/update their own info). I also want an email to be sent (to me) for letting me know they submitted a "needs review" request if possible.

I know this might be a lot to go over but I would really love any help or a good walk through for this.


texts: How to show "Alternative text" of image fields in a custom content type?

texts:
I created a custom content type that its name is News and has an image field with news_image machanic name and I added an alternative text to it from administration page,
now I want to print that alternative text when the node content type twig template rendered.
what I want to achieve finally is schematically something like below:

<img src="#" title="#" alt="Alternative text">

  It seems this problem can be traced back to custom content type only
  because alternative text can be printed without any problem in default content type like article.


texts: How to create a CHANGELOG.txt file for a Drupal project?

texts:
In the page Commit messages - providing history and credit you can find some tips about the creation of the CHANGELOG.txt file, but there are many ways, even if you use the Git Release Notes for Drush you will see many different formats. I can't find if there are a templates like the README.txt template to do this.

Which is the correct way to create a CHANGELOG.txt file for a Drupal project?


texts: Is there any way to insert path to images or links on a content without hard coding it? Our development environment and our production environement have different base paths so the base path of the images and links must not be hard coded.


texts: Alter submitted by text and retain RDF tags

texts:
I am looking to change the submitted by text from:

Submitted by author on Sun, 20/03/2011 - 22:54

to:

Date posted: 20 March 2011

I know how to alter the text in node.tpl.php but I do not know the function that will return the date formatted with the RDF tags around it. Does anyone have experience in this area?


texts: permissions to allow role to edit the posted date

texts: in drupal 7 - I have given a role the permissions to edit, add delete and modify content but he doesn't see the authored date in order to modify it.  how can I give him permissions to modify that ?


texts: How to implement SSO with Oauth2 to login users from another site?

texts:
So, I apologize in advance as I'm only now getting familiar with all the Oauth2 terminology.

I have an existing Drupal 7 site with its own active user base. The organization I support has recently partnered with another organization, and I need to provide access to the new organization's users to the Drupal 7 site. So, I need to implement two specific functionalities:

A "login with Partner Org" credentials option on the login page;
On a re-direct from the partner organization, check if the user is logged in and authenticate them automatically if so.

The partner organization has provided me with an Oauth2 Client ID and Secret; and the re-direct URL is set for the Drupal 7's members home page. I feel like I should mention that the D7 site currently doesn't run HTTPS.

So, how does one go about implementing the following functionality? I've looked around, and it's not really clear to me if this is something that I can implement with a contributed module, or if this is something that I have to do with a custom module?

UPDATE: I'm aware of the OpenID modules as well as Oauth2 client and Authentication. I haven't seen an example or tutorial that gives a good overview of the pieces necessary and how to implement the functionality on D7. Would be open to any overview focused on a generic 3rd party IDP will the modules or steps necessary to implement, particularly addressing user and session management.


texts: How to display a block if a Boolean on/off checkbox is checked?

texts:
I will eventually install Panels to accomplish this. But I can't at this time. I want to allow an editor to display a right sidebar menu on any page when they want by checking a Single on/off checkbox . I added a CCK field to the Page type - Boolean -Single on/off checkbox. I am using Drupal 7.43 on Centos 7 and php 5.4

There is a php block invoke inside another php that checks if a cck field is not null. The first php is looking at the Boolean field  'field_hide_sidebar_menu' to see if it is null or not checked. If it is null it will display the block. This is not working. I have used 'if!empty'
before to check if an image field is null and it works. Now I want it to check if the Boolean is checked or not checked so do I need to write this
in a different way to check if the Boolean value is on or off - equal to 1 or equal to 0. Here is my code:

<?php if (!empty($entity['field_hide_sidebar_menu'])): ?>

Menu
 <?php $block = module_invoke('views', 'block_view',
'menu_sidebar-block_1'); print render($block['content']);?>
<?php
 endif; ?>


texts:
I have some more custom url with og group id like

www.example.com/students/6593
www.example.com/results/6953
www.example.com/book-listing/5367/6953

here 6953 is a group id.

these are the sample link. my questions is how to get the group id from url? And i can't use arg(). because i have more no of url and group id position also varied.

There is any robust solutions for this.


texts: How to setup a Multilingual site using A LOT of taxonomy terms and CCK content taxonomy?

texts:
I am going through the process now of translating my site into multiple languages. I have A LOT of vocabulary terms and I use them with Content Taxonomy CCK fields on my nodes. I don't believe I can have separate vocabularies as the content taxonomy CCK field on the node can only use ONE vocabulary to save to.

So what are my options? What is best practice? I have wanted to offer my site in multiple languages for a long time but just a bit confused.

Also regarding menu items, should I create a separate menu for each language or use the Translate interface and search for each menu text string and add translations. There seem to be multiple ways to do everything and I think this is adding to the level of confusion. Anyone that has done this before it would be a great help!

My site is a online directory of listings, so LOTS of content and a rather complicated interface, so I want to make sure I start this off right, rather than just going into it by guessing. Thanks!

Thanks for the link! But I think you misread the question. I am not referring to menus.

I'm having trouble using localize terms method on vocabularies with the Content Taxonomy field on my node. It's showing both the vocabulary dropdown list of the terms as well as the content taxonomy dropdown list of the terms. They are translating just fine and showing properly, but it shouldn't be displaying double the dropdowns. Content taxonomy should be hiding the Vocabulary dropdown. I am trying to figure out why it's not. any ideas?


texts: Unable to create new users with Organic Groups module installed

texts:
I have Organic Groups version 7.x-2.9 installed on a Drupal 7.50 install.

When I try to add users from /admin/people/create I get a white screen and the error

  PHP Fatal error:  Call to undefined method
  EntityReference_SelectionHandler_Broken::buildEntityFieldQuery() in
  /var/www/sandbox/sites/all/modules/contrib/og/plugins/entityreference/selection/OgSelectionHandler.class.php
  on line 79, referer: http://drupal.sandbox/node/25

Does anybody know how I fix this? Otherwise I can't use Organic Groups module, I guess I'll have to try the Group module instead.

I found this issue on Drupal.org but there doesn't seem to be a fix for it

https://www.drupal.org/node/1796980

What is it about my site that might be causing this? Presumably there are 32,461 other Drupal sites running successfully with OG installed.

UPDATE - I subsequently installed the same version of OG on a different Drupal site where I am not seeing this problem, so it must be something weird about the first site.


texts: Show Taxonomy Terms belonging to search_api search result nodes

texts:
Using search_api (and search_api_solr) i have a view that shows nodes for (in this case) Organisations in a search_view. That works very nicely.

Now, I would like to show a list of taxonomy terms that are associated with the nodes in the result set. These terms should be in a list of their own, and I need to be able to access the fields on these terms. (In this case, Districts is the Vocabulary, and each organisation can be active in 1 or more Districts. I need to get to the Geofield on these Districts so I can create an Openlayers map).

When I add a Relationship to the search_view to the District field, I see the message

"Note: This is a multi-valued relationship, which is currently not supported. Only the first related entity will be shown."

So, that is not the way (yet).

I am stuck thinking about a workaround for this. Any pointer would be much appreciated.


texts: Get path alias from NID (or node object)

texts:
I have a node object, and I am trying to use it to get a given path in Drupal 8.

There was drupal_lookup_path() in Drupal 7 but I'm not seeing any equivalent or documentation for Drupal 8.

What's the new "Drupal" way to get a path from a node object?

Would it be something simple like $node->get('path')?

This seems like a simple question, but I'm just absolutely not finding any documentation on it.

Notice I do not want the path alias for the current path; I want the path alias for an arbitrary node, given a node object or a node ID.


texts:
I have downloaded the Drupal and was installing it first time, initially it was giving me an error message in the database base configuration step and then after that started giving the

  The website encountered an unexpected error. Please try again later.

Can anyone tell me what might be the reason?


texts:
I need to set a field value as CSS class in a page template. How can I do it the Twig way?

{{attributes.addClass('class-name')}} is the way to set the class manually.

I have a list field to let the user set a background color for a part of the site. In Drupal 7 I used this code.

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

In Drupal 8, I can print the field with {{ content.field_background }}, but
 doesn't work.


texts: I accidentally created a stable release for a module instead of dev. So now how do I delete the stable release node on drupal.org


texts: Image preview not showing on add/edit page

texts:
Preview of the uploaded images are not showing on the node add/edit page but images are uploaded correctly. We're using Lightning Acquia distribution and using Entity browser for the image field.

What could be the possible issue?


texts: Panels Accordian - "this pane needs a title" Message

texts:
Hello i have an install of Panoply on MY WEBSITE. I cant work out if Panels Accordian Style came with panoply or if its default. Ive stripped Panolpy right down and still dont see anything that could be cauing my Panels Accord Style barr it coming with panles so anyhow.

When i use the style i get an 'This pane needs a title!' message on all my block headers. Can anyone work out why this maybe so?

Thanks


texts:
I've two forms in a page, one of the field name is same in both forms.

<form id="form1">

        <select id="field_a" name="field_a_name"> ... </select>

</form>

<form id="form2">

        <select id="field_a" name="field_a_name"> ... </select>

</form>

In hook form_alter, i assign the states to the field:

 $field_state = array( 'visible' => array(':input[name="field_a_name"]'
 => array( array('value' => 'H') ))       );

 $form['field_a_name']['#states']   = $field_state;

The state does not work as expected, i believe it's caused by the same field name, most likely because of the jquery selector confused with the two fields with same name.

It works fine if the field name are different.

How to solve this?


texts:
I am using Drupal 8.05

I am unable to add a new user. I get the following error when I press "Add User" button:

Drupal\Core\Entity\Query\QueryException: 'field_housing_coop_ref' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 252 of core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).

'field_housing_coop_ref' was an entity reference field (pointing to Content Type A) on Content Type B. I deleted the 'field_housing_coop_ref' field and get the error.

If I recreate the field then I can add a new user. When I delete the field I get the error again.

I put this on the Drupal core issues list as support request but it got closed as not a reproducible error. So it seems to be something particular to my site.

Currently I have the field existing but unused and hidden on the form/display modes. Any idea about what I have done and how I might better resolve this much appreciated.


texts: View (Read Only) access for Drupal Commerce - Orders

texts:
I have added 2 attributes into my Drupal Commerce Orders set of fields - Fivestar Rating & Review. My client needs me to show the ratings and reviews in "Testimonial" section of home page in ticker format. I was able to successfully integrating Rating + Review into Orders and show the testimonial section for users with role as Admin.

Below pictures show my configuration:

A chunk (Sidebar second) of my home page for Admin user with running ticker:

However, the anonymous visitor to the webiste is not able to view the contents of this ticker because anonymous does not has view access on the orders created in the website:

Now, ideally the orders (and hence the ratings and reviews inside the orders) should be accessible to the anonymous users. But yet, the ticker does not show any content and also the Orders page "/admin/commerce/orders" will not show any orders at all:

I need help with the following 2 items:

Why anonymous user is still not granted the view permission for the orders (and it's contents). How can I fix this?
I do see that there is a security implication even to provide "View" access to anonymous users on my Orders. How serious is this threat? Is there any safer way to get view access to orders and its contents? What is the right way of doing this?

Thanks for any efforts by the community to help me out :)


texts: How do I figure out what module is using drupal_set_message()?

texts:
Some module is using drupal_set_message() to show a message at the top of the administrative pages.

I would like to figure out from where it is coming from. Is there any way to determine what module is creating it? How do I remove it?


texts:
With Drupal and views you can generate a table with for example a list of users and their contact details.

Let's say I have a user outside of the system that I want to add to the table statically, what's the best way to do this in Drupal?

The ways I am thinking of are:

Write a module that db_select or use enityfieldquery into an array, add the external user info and put it through theme table and outputs it on a page.

Override the views template and add the user info there.

Are there better ways?


texts: How do I add block configuration information for themes using features?

texts: Is it possible to use features to manage block configuration information (for example, the positioning of a block [header, footer, etc.]) using features?


texts: Token Filter module to work on Menu URL and Title

texts: menu_token module is working fine to achieve the purpose. Does the module token_filter has this functionality? I can use tokens in wysiwyg using token_filter but cannot make it working for menu title or url since there is no setting I could find. Since the comment in drupal issue says that it was solved using token_filter module, I want to know the way it was achieved.


texts: Language icon selector bug with webforms, fix or alternative?

texts:
i have installed a few modules for internationalization support, like:

i18n
i10n
icons
lang_dropdown
i18n_string
i18n_field
entity translation
webform_localization

The issue is relative to webform content, i have several pages where the language selector block i put left to menu works with a dropdown with the language as wanted.

But when i'm in the webform, it should show 2 languages but only shows the default one, how do i fix it?, is it a bug in webform_localization or in language icons or lang_dropdown?


texts:
How can I disable the scroll to top behavior in an Ajax based View? Preferably, with Javascript.

The scroll behavior is triggered when running a search from an Exposed Form.


texts: How do I add menu items within a .install file

texts: I'm trying to build an intall profile that implements a number if features. I am running into some issues because although features allows me to require menus, it seems there is no way to also include the links (most of the link are simple aliases to add content or edit views). Is there a way to add menu items from within the install profile?


texts: Disable cache on base url for redirecting unauthenticated users

texts:
I am trying to redirect unauthenticated users. So anytime an unauthenticated user tries to get to the base url, redirect them to an external url. Currently works, but continues to redirect to the external url even after user is authenticated and logged in. So I am trying to disable cache whenever the base URL is accessed.

Here is my current code for redirecting in my src/EventSubscriber/RedirectAnonymousSubscriber.php file:

class RedirectAnonymousSubscriber implements EventSubscriberInterface {
  private $redirectCode = 301;

  public function checkForRedirection(GetResponseEvent $event) {
//    to kill page caching:
//    \Drupal::service('page_cache_kill_switch')->trigger();
    $is_authenticated = \Drupal::currentUser()->isAuthenticated();
    $route_name = \Drupal::routeMatch()->getRouteName();

    if (!$is_authenticated && $route_name !== 'user.login') {
      $response = new RedirectResponse('https://example.com', $this->redirectCode);
      $response->send();
      exit(0);
    }
  }

  public static function getSubscribedEvents() {
    $events[KernelEvents::REQUEST][] = array('checkForRedirection', 30);
    return $events;
  }
}

Would that would be the correct way to go about things? And how would I go about implementing that in my *.routing.yml file and elsewhere?
Thanks!


texts: How to list Taxonomy Terms with Pictures in View?

texts:
I want to create a View with the list of Taxonomy Terms in Drupal 7.
I edit the taxonomy content type so that it has 1 extra image field.

I want to show all Taxonomy terms with their image but I cant seem to find it anywhere in View options.


texts: Does drupal_add_js and drupal_add_css validate external files

texts: Should I validate the existence of an external js or css with drupal_http_request before I add with with drupal_add_css or drupal_add_js, if no can somebody point me in the right direction where is this taken care of?


texts: How should I redirect users based on role if there are 100s of roles?

texts:
I am creating an evaluation webform where students evaluate both instructor and lab location on the same form based on class section number.

How do I redirect students to the correct form if there are 100s of sections?

Writing conditional based logic on global $user and checking for roles seems trivial. Login Destination will do the trick, but not sure how to handle 100s roles.

EDIT: The url structure would something along the lines of:

class/section/instructor or class/section/lab

Caveats: One instructor could belong to many sections since they can teach any number of classes.

Edit #2 Main entities/fields on the form are:

Instructor: can belong to many classes and sections

Class Name: i.e. Industrial Economy. A single class can have many sections (or units in laymen's term).

Section: belongs to a single class.

Class Number: Classnumber-followed by section number ie. ABC23343-34 (the last two digits are class section).

Key identifier and workflows:

Once a student logs in, he/she should see the list of classes they belongs to and fill out the evaluation form for that section. Essentially, a single student could have 5 or 6 forms. Apologies! this changes the question a bit. Actual form content stays the same (so a single form could be used as a template to attach to many entities).


texts: Configuring Drupal with a dynamic IP address

texts:
I have now a problem with the multisite configuration of Drupal 7 installed on my linux machine.
I want this site to be accessible from outsite from my local machine. For this I have a domain name from no-ip, that redirects the requests to my machine, and a multisite Drupal 7 configuration.
When I check the configuration, I am facing the result below:

I can access the non-drupal sites with no problem from the linux
machine using the mydomain.no-ip.org address.
I can access the drupal sites with no problem from the linux machine using the local network address (192.168.1....).
I CAN'T correctly access the drupal sites (drupalsite1, drupalsite2) from the linux machine using the local network address. This is the problem: I am redirected to the main drupal site, although I request the drupalsite1.

And, for information, I can't access the linux machine from my W7 other machine using the mydomain.no-ip.org address (I have the STB interface). All is right with local addresses.

It seems that Drupal doesn't recognize the specified drupal site I want to get, and then redirects me to the default main drupal site.
Has somebody any idea?
May I get any example of Drupal configuration working with a dynip or no-ip service?

I am quite newbie in D7.

Thanks in advance.


texts: Controlling access to audio - use field in content or separate audio content type?

texts:
I am well underway with converting my website to drupal. The site contains guitar lessons. All content has been imported into drupal. I have lesson and exercise content types. A lesson can contain several exercises, and exercises can contain audio for instance. The way I set it up, I created custom filed for audio. But maybe audio should be content type and then I would use Entity Reference to link audio with exercises, much as I link exercises to lessons?

Now that I have been learning about page manager and selection rules, etc, I am trying to figure out if my chosen structure will support the behaviors I need. For instance, I want to make it so that listening to audio requires a visitor be registered - so in exercise panel/pane non-registered user would see a play audio button that would redirect them to a registration page. Registered users would see the embedded audio player. Right now audio is displayed as a regular field but I am thinking maybe this will cause problems later.

Based on above, can I accomplish what I need as I have it set up now, or do I need to organize/think differently? How would you organize?

Thanks!


texts: Display blog posts from Wordpress to my Drupal site and filter it by taxonomy terms

texts: I am new to Drupal and need some help. I have a Wordpress blog and a Drupal (version 7) website. I want to display a few blog posts from Wordpress onto my Drupal site. The problem is that I want to select/filter the blog posts based on taxonomy terms I've created in Drupal (blog posts will have corresponding tags for filtering). How can I do this?


texts: How do I modify a core field to use Ajax and add markup?

texts:
I am still getting the hang of D8... I have some entity types with various reference fields. I need to ajax in other values from another node type when changing the value of the entity reference select field I have.

Node type form 1:

#####################################
#  _____                            #
# |Title|                           #
#  ___________                      #
# |Description|                     #
#  _______________________________  #
# |Node type 2 select reference |v| #
#                                   #
#####################################

Whenever I select a node from the Node type 2 select reference field I would like to Ajax in a specific view mode of the node as #suffix markup. After selecting a node the resulting form should look like this:

#####################################
#  _____                            #
# |Title|                           #
#  ___________                      #
# |Description|                     #
#  _________________________        #
# |Some node (node id: 2) |v|       #
#                                   #
#  * Node 2 value from field 'a'    #
#  * Node 2 value from field 'b'    #
#                                   #
#####################################

I have attempted using #ajax property in a hook_form_alter on the select field but am not getting it to work due to errors. What is the best approach here?


texts: What is the Correct UID path whilst using Ubercart Affiliate in Custom DB

texts:
I'm currently building a various user dashboard using my own custom hacked Workbench (WB) & cloned from one Master for end users (3 roles ex SU). WB chosen over Homebox as that was taking me too long and WB seems easier to integrate Views etc. FYI, I'm working on a D7.2x local Linux Ubuntu webdev box using the system localhost.

Things are going well and general path links to modules link well (Support tickets, Messages etc). However, one of the options I'm offering is the Ubercart Affiliate and whilst that module is working fine, I cannot for the life of me get a users Affiliate account path to show up correctly via a direct link from the Workbench. I require the path to be simply: site/user/affiliate linking direct the Affiliate dashboard (DB).

For my benefit, for now I created Custom Content Pane (as opposed to a Block) and simply created HTML links into it as one would do (using 'other' as the option URL settings. The other links work fine linking to the relevant modules, but the link to users main Affiliate DB overview won't work. I set "Affiliate Center" as the link to the UC Affiliate DB but am I either confused over the correct path structure or something is missing or both.

For example, user' joetest' can login and is redirected on login to his WB and all shows aok. joetest can access his UC DB via: [http://localhost/sitename/user/12/affiliate] but what I presumed was correct (...sitename/user/%/affiliate) or .../user/uid/affiliate) neither don't work and gives me an error message of what I expect, "affilate shop not found etc...".

I know it's a path issue (Redirect, Pathauto, URL-Alias) but I cannot figure it out. I checked all permissions and others.

I'm quite happy for the end result to be:  in order for the user to access their said UC Affiliate main 'home' DB even maybe using the ME module? I'm not sure.

Presume this should be a five minute setup, but a few hours later, I'm getting stumped now but simply want to user to be able to view, edit, amend their Affilate details but via either a link on their WB. Not looking to use Menu tabs as I'm wanting a very light, minimal structure.

Any advice great appreciated.

Ok, I'm a learning 'novice', but probably missing a small point on the path structure knowledge. (:
Thanks in advance.


texts: Installing Drush - permission denied error

texts:
I just successfully installed Drush user composer into the .composer/vendor/bin folder.  When I try to run "drush status" I get an error
sh: /Users/Marianna/drush: Permission denied

What do I do now?


texts: How to create template file for specific node?

texts:
As I asked above is it possible to create template file for specific node id.
I now we can create template file for content type, but not clear for node id.

E.g. Suppose there are 10 Articles in website, each has node id from 1-10.
Now question is I want to create template file for node id 3. When user visit article node id 4, then user will see different page.


texts: copy term reference from one to other field

texts:
I have two fields (fieldtype = term reference) in the same content type and I would like to copy the settings from the first to the second one. After searching for a solution I found this thread but I think the description I need is just the one that is not available:

  "Copy contents of a CCK node reference field to another CCK node
  reference field"

Can somebody give me some guidelines, or even an explanation how to achieve this?


texts:
I've been making this cordova app against this casting agency website, and I've come across this nasty situation where I need to list each user's created nodes. For this purpose, I have created a view with the contextual filter uid and it's taking the uid from the logged user. I also have this fiddle where I am trying to list each user's nodes. However, it's returning empty (2nd ajax call). The weird thing is, it lists the nodes by the logged in user on this URL username is tolga and password is 111222.

The steps I have taken to debug:

Hardcode the username and password.
Hardcode the uid in the 2nd ajax call without deleting the 1st one.
Delete the 1st ajax call.
After deleting the 1st call, hardcode the uid in the 2nd call.
After deleting the 1st call, not pass the uid at all because I have configured the contextual filter to take the uid from the logged in user.

Nothing worked. Am I missing something? Do I need to use something like Services Views?

UPDATE: I tried using Services Views, and I ended up a whole lot of 404: Resource not found messages. Docs for the module and views say different things for path; docs say http://www.example.com/<endpoint-path>/views/<view-name> while the view says to put the path name after the endpoint path (in my case, services)


texts: Trying to access my old Drupal 6 site and getting an error

texts:
A few years back i created a Drupal 6 site and due to sickness i had to leave it. Well i am moving hosting and wanted to move this site over. I tried to hit the site but get this error. I assume something needs updating but wondered is there any tricks to gain access to the panel to update this site?

  Fatal error: Uncaught Error: Call to undefined function ereg() in /homepages/28/d2287/htdocs/includes/file.inc:1085 Stack trace: #0 /homepages/28/d2287/htdocs/includes/file.inc(1083): file_scan_directory('themes/bluemari...', '\.info$', Array, 0, true, 'name', 1, 1) #1 /homepages/28/d2287/htdocs/includes/common.inc(2888): file_scan_directory('themes', '\.info$', Array, 0, true, 'name', 1) #2 /homepages/28/d2287/htdocs/modules/system/system.module(868): drupal_system_listing('\.info$', 'themes') #3 /homepages/28/d2287/htdocs/includes/theme.inc(493): _system_theme_data() #4 /homepages/28/d2287/htdocs/includes/theme.maintenance.inc(51): list_themes() #5 /homepages/28/d2287/htdocs/includes/bootstrap.inc(1228): _drupal_maintenance_theme() #6 /homepages/28/d2287/htdocs/includes/database.inc(176): drupal_maintenance_theme() #7 /homepages/28/d2287/htdocs/includes/database.mysql.inc(55): _db_error_page('Unable to use t...') #8 /homepages/28/d2287/htdocs/includes/database.inc(152 in /homepages/28/d2287/htdocs/includes/file.inc on line 1085

Would appreciate some pointers on what steps i should take to recover the site.

John


texts: How to restrict date entries dynamicly based on previously added line item to orders?

texts:
To be a bit more precise...
I am building a webshop, where customers will be able to place orders containing celebration cakes. The main issue is, that the cake makers has got a limited capacity per day (as it takes time to make the cakes). Scaling the bakery and the staff suddenly is not an option. The client want to also avoid calling the customer, if their chosen date is already been fully booked when they placed the order (and is also not professional). For that reason I would like to monitor the incoming orders, and if the ordered cakes reaches the daily limit, then not to allow further orders to be placed for that day.
I can make A custom module, which is collecting the dates into a table and also adding quantities to that as well, But I am struggling to restrict the available dates based on that list.
So the question is simple. Is there a way to overcome this issue? If yes (I feel it) then can someone give some instructions on how to solve this issue?


texts: How do I Print/Display Site information Form

texts:
I'm trying to print the Site Information Form, and a series of other forms in the near future, inside a lightbox using a snippet of code I found similar to the following.

global $user;
module_load_include('inc', 'user', 'user.pages');
print user_edit($user);

This, along with some other code not mentioned, will display the user account form. But I'd like to know how do I print the Site Info Form, and any other form I may wish to display in the future? What process or methods can I use to find out what I need to do?

I hope I'm not being too vague. Any pseduo-code, suggestions or even a hint would be greatly appreciated.

Thanks.


texts: Get field value directly from inside views-view-list.tpl.php

texts:
Inside views-view-list.tpl.php there is a loop like this:

<?php foreach ($rows as $id => $row): ?>
  <li class="<?php print $classes_array[$id]; ?>"><?php print $row; ?>

<?php endforeach; ?>

I want to be able to access the actual values of the fields inside each item, rather than passing off the rendering of the html to views-view-fields.tpl.php.

In pseudocode, I would like to do this (THIS CODE DOES NOT WORK):

<?php foreach ($rows as $id => $row): ?>
  <?php print $row->$fields['field_my_field_name']; ?>
<?php endforeach; ?>

<?php foreach ($rows as $id => $row): ?>
  <?php print $row->$fields['field_my_second_field_name']; ?>
<?php endforeach; ?>

Would I actually use the $row object, or would I use something else?


texts:
Each of my products has it own attribute with an expiration date. How can I auto unchecked the option when it expires?

I know there is a module call scheduler which can help to auto publish and unpublished the node. How about the attribute?


texts: How to consume data about drupal contributed modules?

texts:
Is there a feed or feeds that expose data about all drupal contributed modules? I want to consume drupal.org data about modules in a certain category e.g. https://drupal.org/project/modules?f[0]=im_vid_3%3A59

I would love to get the catagories information e.g "Categories: Actively maintained, Under active development, Administration, Modules, Developer, Site Navigation"

I've seen http://drupal.org/node/63589, but the "Compatible with Drupal core 7.x" (http://drupal.org/taxonomy/term/103/0/feed) only lists about 72 ftp urls when I load it in a web browser.  That is not all of the D7 modules...

I also looked at the About page on http://drupalmodules.com for clues about how they get the data, but didn't find anything useful.

Thanks for any pointers!


texts:
What I'm trying to do seems simple, and I'm sure it is, I just don't know what theme files need to be modified and how to modify them.

I want to make the user profile page display the user's first and last name (custom fields assigned to the User profile) as the title, rather than their username (which is default).

What I'm assuming can be done is intercept the title variable somewhere and change it to what I want.

How can I do this?

Cheers.


texts: How do I edit the format of things published to the front page?

texts:
How do I change the way info is published to the front page?

For example, it gives me a title, 1 paragraph of body, date, tags and a read more button.  I need to set it so that it also gives me a particular image field from a custom content type on top of the body content.

Where do I make this correction?  I don't see it anywhere in views and I don't want to redesign my front-page around a different block / new view.


texts: Is there a way to add a persistent querystring across multiple pages?

texts:
I want to add a persistent query string to pages once it is introduced (for the context module to maintain a page layout inside an iframe). At the moment, I'm checking the http referer for the string and redirecting to the current url + query string.
This works fine, except:

It's an extra page load. Not a big issue as it's an admin page inside an iframe that's not used much.
It breaks batch pages. I think I can get around this by checking if arg(0) is "batch" and then add the referer to $_session and then check for it.

This seems really convoluted, hacky and prone to breaking the site for a user if I don't get the session variable deleted straight away.

hook_url_outbound_alter() doesn't work for forms unfortunately so is there a better way?


texts: How is the height defined for a region in a Drupal theme?

texts:
I can see that regions are defined in the .info file for a theme but I can't see how these regions relate to CSS that would be used to style them.

For example, in the acq_minimal / Minimal theme, the Header region has a fixed height but I have examined defaults.css and other css files and the .php template files but I can't see how its height is defined.

The Header region height is fixed rather than flexible to the content within it, because if I put text in it with a really large font, this spills over other regions - i.e. the Header region does not stretch to fit.

But preferably I simply want to know how to change the height of the Header region (and other headers). Knowing how to change the width and set the position would also be useful.

Please advise.


texts: Feeds: update nodes using a second import

texts:
Is there a way in which you can use a second feeds import, to update nodes created during a first import?

In my first import, I create nodes and save a custom ID (from old system), and I want to reuse that custom ID in the second import to update the existing nodes and add a taxonomy value.

First importer:

Second importer:


texts: need popup display of term definition in page contents

texts:
I have glossary terms in site as glossary type content. Client now wants to have each instance of each term linked to the term explanation, to popup when user hovers over term.

Suggestions? Modules? Magic?


texts: Location Module Fields not showing up in search api fields

texts: Is there a way to show location fields using the location module in Search API fields?


texts: How to make "Backup & Migrate" not backup my Backups?

texts:
I am configuring a backup-automatism with Backup & Migrate to regularly save a copy of the site and my database on the server. The scheduling works quite well and every week a copy of the site is stored in my private directory.
Unfortunately it also stores my recent backups, so the size of each backup increases over time.
There is a field in the "Backup & Migrate" settings for that, but it seems to ignore all the input.

(Backups are all stored in the folder "backup_migrate" in the private-files directory)

Does anyone have a solution for my issue?


texts: Developing sites while using Aegir and Drush make

texts:
I read this article from mig5.net about 'Drupal deployments & workflows with version control, drush_make, and Aegir'. I am impressed by the efficiency of the workflow described here, and I really want to implement this. I read it again and again, but one thing won't get clear to me.

How do you, while developing websites, get your changes into the next build? When you find out you need an extra module, how can you get this in the next build when the (for example contrib) module isn't controlled in git? Do you need to edit your .make file every time you want to add a module, library etc.?

Thanks in advance.


texts:
I'm using Omega theme. But when search my site on Google, description is site menu items. I want change this area via spesific word.

So, open my template.php file and add this codes:

function site_page_alter($page) {
   $meta_description = array(
            '#type' => 'My Site Desc',
            '#tag' => 'My Site Desc',
            '#attributes' => array(
                'name' => 'My Site Desc',
                'content' =>  'My Site Desc'
            )
   );

drupal_add_html_head( $meta_description, 'My Site Desc' );
}

function manualMetaTags($path) {
    $description = "My Site Desc";
    $keywords    = "My Site Desc";
    print "<meta name='description' content='".$description."' />\n";
    print "<meta name='keywords' content='".$keywords."' />\n";
}

And add main.js:

<head profile="<?php print $grddl_profile; ?>">
  <?php print $head; ?>
  <title><?php print $head_title; ?></title>
<?php manualMetaTags($_GET['q']); ?>
  <?php print $styles; ?>
  <?php print $scripts; ?>
<script type="text/javascript">

After, send sitemap to Google. My description is seen but with menu items.

E.G.

My site desc on Google:

MAIN - NEWS - CONTACT

When add codes:

My Site Desc MAIN - NEWS - CONTACT

But i want only seen My Site Desc. How can i do it?


texts: Drupal Commerce order total amount not update after I programmatically changed line item's price

texts:
I am using Drupal Commerce. Now I have to alter the product price programmatically. After search on google and here, I found some people did it:
Alter cart unit price and total amount

Then I made a test by using hook_commerce_cart_order_refresh(). Here is my code:

function mymodule_commerce_cart_order_refresh($order_wrapper){
    foreach ($order_wrapper->commerce_line_items as $delta => $line_item_wrapper) {
        $line_item = $line_item_wrapper->value();
        $qty = $line_item->quantity;
        $line_item->commerce_unit_price['und']['0']['amount']=100;
        $line_item->commerce_total['und']['0']['amount']=$qty*100;
        commerce_line_item_save($line_item);
    }
}

It changed the cart and order line item unit price and line item totoal amont. But the order total will not changed. Still calculated on the old price.

I also notice somebody have the same question:Order Total not updating after I change the line item price , but I don't know that answer how it works. It said using following code:

The solution was to use commerce_price_add_component()

$line_item_wrapper = entity_metadata_wrapper("commerce_line_item", $commerce_line_item);
$line_item_wrapper->commerce_unit_price->data = commerce_price_component_add(
    $line_item_wrapper->commerce_unit_price->value(),
    'base_price',
    array(
            'amount' => $booking_price,
            'currency_code' => 'AUD',
            'data' => array(),
    ),
    TRUE
);

But I don't know where to use the above code, put in a hook?

Is some one can give me a idea?


texts: View my local site on smartphone and tablet

texts:
I want to view my website on my iPad and iPhone to take a look how my responsive design looks like. I'm running on a macbook air and I was wondering if there is any type of way to run my local drupal site on the ipad or iphone. I heard you could connect through the ip or somehow. Any ideas?

Anyone done this before?


texts:
Features seem to be the right way to import custom centent type in a fresh D7 install from a D6.
But when I create my feature on the D6 one, it added dependencies like modules,and once I import the module on D7, these aren't satisfied because D7 module version doesn't yet exist or it's not recognized..

How can I figure out this ? it's about CCK submodules (filefield,imagefield..)

thanks


texts: How to create a folder after clicking on a button?

texts:
I got a requirement like this: In the admin page there should be one create folder button, user can create a new folders as per his wish. How can I achieve this programaticaly.
Till now I created a admin page there one button is also coming, but I am not getting how to proceed further.So please give some suggestions, thanks in advance.
 Below code I have tried.

  $form['create_folder'] = array(
    '#type' => 'submit',
    '#value' => t('Create folder'),
    '#submit' => 'custom_submit',
  );
function custom_submit($form, &$form_state){
  $new_folder = 'public://newfolder/';
  file_prepare_directory($new_folder, FILE_CREATE_DIRECTORY);
}

When I click on the submit button I got this warning Warning: Invalid argument supplied for foreach() in form_execute_handlers() (line 1507 of C:\xampp\htdocs\drupaltest\includes\form.inc).


texts: How do I get the block title from the plugin implementing it?

texts:
I'm attempting to print the value of the title of the block in a block plugin.

public function build() {
    $build ='
        <div class="header-text">
            <'.$this->configuration['header-size-submit'].'>'.$this->title.'</'.$this->configuration['header-size-submit'].'>
        </div>
            ';
    return array(
        '#type' => 'text',
        '#markup' => $build,
        );
}

I attempted to get the value of the title by using

$this->title

But that did not work.


texts: Unable to change date format on node created field

texts:
On my article content type, I enabled "Display author and date information" but am unable to change the date format.

I'm using Druapl 8.0.0-beta14 with a sub-theme based on Classy. The field's value is already computed by the time the twig template and hook_preprocess_field get to it but was able to chase down the setting of the date format to the defaultSettings method in TimestampFormatter.php using a debugger.

    public static function defaultSettings() {
      return array(
        'date_format' => 'medium',
        'custom_date_format' => '',
        'timezone' => '',
      ) + parent::defaultSettings();
    }

So far, I haven't found a place in the admin UI or yaml files (or a hook, which I know I probably shouldn't be doing too much of in D8) where the date format can be changed. Interestingly enough, this "field" on the node seems to be some sort of pseudo-field, because the value is actually the timestamp on the revision_timestamp field in the node_revision table.

That said, how can I change the date format for this "field"?


texts: Drupal Commerce - creating a product catalog

texts:
I've downloaded Drupal Commerce and created my 3 products. Everything else I've kept as the default. Then I wanted to created a catalog so users could buy items. Note: I've also installed and input API credentials for Drupal Paypal already. So then I went to create a view of type 'product display' as seen here:

https://drupalcommerce.org/user-guide/setting-product-catalog

But when I create a new view 'product display' is not one of the 'type' options.

So my question is, how do I get something to show as a product display item? somehow it seems I have to map the products I created to 'content types'...but shouldn't the module already do that?

I looked back through the documentation on that site, and undoubtedly I missed something, but I'm not seeing how this is done.

Note #2: I tried to install commerce kickstart, but I'm using WAMP and couldn't get it to work, so I have to trudge through on my own.


texts: how to dynamically add new fields to a form using ajax?

texts:
I need to add the options array for a select field based on the first one
like

<?php

function lists_form_alter(&$form,&$form_state,$form_id){
    $governments=array();
  if($form_id == 'place_node_form'){
      /*$vocabularies=  taxonomy_get_vocabularies();

      foreach($vocabularies as $vocab){
          if($vocab->machine_name =='listings'){
              //
              //$_SESSION['vid']=$vocab->vid;
              break;
          }
      }*/
            $options=array();
      $g=taxonomy_get_tree(23,0,1,FALSE);
      $x=count($g);
      for($i=0;$i<$x;$i++){
                $city[$i] = taxonomy_get_children($g[$i]->tid,23);
                      $options[$g[$i+1]->tid]=$g[$i]->name;
      }
      }
                  $options[0]='choose the government';

       $form['gov']=array('#title'=>'Gov','#name'=>'governorate','#type'=>'select','#options'=>$options,
           '#suffix'=>'

'
           ,'#ajax'=>array('callback'=>'ajax_callback','event'=>'change','wrapper'=>'replace','method'=>'replace'));

isset($form_state['values']['governorate']) ? $op=taxonomy_get_children($form_state['values']['governorate'],23)
        : $op='';
$form['city']=array("#title"=>'City','#name'=>'city','#type'=>'select','#prefix' => '
',
        '#suffix' => '
',
           '#options'=> $op);

}

function ajax_callback($form_state,$form){
    $form_state['rebuild']=true;
    return $form['city'];
}

?>

what's wrong here?


texts:
I want to use field_groups in my content type to make it easier to deal with a long content type, but I don't want that group (probably a fieldset) to be rendered at all on the client-facing side.

How do I control that?


texts: What is the syntax for the 'Query string value' in a view argument input?

texts:
down vote favorite
share [g+] share [fb] share [tw]

In Views (3.3) you have the possibility to provide an argument input once you set up a relationship and a contextual filter. One option is to get this argument from the Query string value.

I tried it with visiting a link like this:

....url_to_view_page?argument=foo

and also

....url_to_view_page?foo

and even

....url_to_view_page?q=foo

But it doesn't seem to work. What is the correct syntax for this in the URL?


texts:
My client wants a site where registered users can create paid offers of rooms to rent and other users can book those rooms. Users who created offers should be able to see those  reservations.

I think that registered users could create offers as nodes with payment options using the Pay-per-node module. I don't know how to create the booking feature. I tried to use a few modules, but none was proper for my goal.


texts: I've altered the exposed filters how I want them in hook_views_pre_build(). How do I retain those settings after an AJAX filter is used?

texts:
In Drupal 7, I have a content type that displays a content view within it.  This view display contains 4 exposed filters. On the content type, I have a custom select field which allows the author to choose which exposed filters they want to hide on the embedded view.
I then take these selections from the node. Using hook_views_pre_build(), I'm able to hide (by unsetting) any filter they don't want. It works great upon initial load of the page.
However, the exposed filters use AJAX.  When a visitor uses one of the exposed filters and the view loads the filtered display, it no longer respects my hook_views_pre_build() settings. Any filter I hid in that hook are now exposed again in the AJAX-generated views display.
Which hook (or combination of hooks) can I use to hide filters not only in the initial page load, but also when an AJAX filter is used/loaded and the view refreshes?


texts:
I have 2 content types courses and courses_type, I added courses_types as node reference in courses.

when going to build view to dispaly all courses with thier courses_type the courses_type column is empty. what i am doing wrong?


texts: Drupal 7 / Wysiwyg module + full ckeditor : how to add downloaded plugins

texts:
In drupal 7, I've installed the wysiwyg module. I downloaded the full ckeditor into sites/all/libraries.

I selected ckeditor to use as my wysiwyg editor in the drupal admin. Next, I can create a wyswiyg profile and toggle plugins on and off, amongst others.

I even created a module to add some custom things using HOOK_wysiwyg_editor_settings_alter. So I know all that.

But when I want to add ckeditor addons downloaded from the web, I have mixed results. Some just work if I add them to the sites/all/libraries/ckeditor/plugins folder and add a line to HOOK_wysiwyg_editor_settings_alter to register the plugin.

But some don't. And I never see the plugins reflected in my wysiwyg profile in the admin.

What is the proper way to add plugins to the full ckeditor when using the wysiwyg module ?


texts: Mass Node Update (e.g., disable comments for all nodes of a given content type)

texts:
Is it possible to mass update nodes from, say, "Comments Read/Write" to "Comments Disabled" for all nodes of a certain content type?

I changed the Content Type setting and that worked for all the other nodes types, except for a certain Node type that has given us problems in the past.

Thx


texts: Default to MyISAM instead of InnoDB in Drupal 7

texts: Can I make Drupal default to MyISAM for new tables instead of InnoDB? Except for hacking the core, that is.


texts:
I am referring to this page.

I need to use the administration theme on this page, but this is blocked by default.

At the moment I have to go to the theme page, change to my admin theme, and then change back when I have made the changes I need.

Is there anyway I can set this up using the Themekey module? It is beginning to be a major problem for my client.


texts: Create View with a join on the same content type

texts:
I am trying to create a View that produces 1 stop itineraries. I have a content type "Route", with the following fields.

From To Method

The data looks like:

From | To | Method
 A   | B  | Method 1
 A   | Z  | Method 3
 B   | C  | Method 3
 Z   | C  | Method 3

If a user searches "From: A", "To: C", the view should return:

From | To | From | To |
 A   | B  |  B   |  C |
 A   | Z  |  Z   |  C |

which ultimately results in B and Z as the intersection points (and a more friendly output to the user).

From | Via | To
 A   |  B  | C
 A   |  Z  | C

For the life of me, I cannot figure out how to produce this join against the route table.

Any advice? I have even replicated the Route content type to "Route 2", and attempted a relationship on the inner "From" and "To" fields of Route and Route 2, but cannot produce this expected output.
Any advice?


texts: How do I install Drush 9 on Windows 7 with Composer?

texts:
Should I globally install Drush and use it locally, or should I use install and use it locally?

I globally installed it with Composer, then added C:\Users\Md. Shafiq Hossain\AppData\Roaming\Composer\vendor\drush\drush to the PATH variable.

When I change the current directory C:\My Work2\src\Drupal\clientname\projectname and type drush version, it gives me the following error.

  'C:/Users/Md.' is not recognized as an internal or external command, operable program or batch file

I tried with the project wise. I installed correctly, but drush version returns the following error.

  Drush is not recognize as internal or external command

If anyone can help me on this will be great.


texts:
I have a view in which I want to have a link that passes the current exposed filters values through to another custom page (not a view).

For example if the "Day One" checkbox is checked I want my link to be able to reflect this checkboxes value.

Link

Is there some form of array where all exposed values are stored when a view is shown? I can't seem to find one


texts: Modifying CSS class of Menu Block links?

texts:
The Menu Block offers several hooks to override the markup it generates:

#theme:
  menu_link__menu_block__1
  menu_link__menu_block__main_menu
  menu_link__menu_block
  menu_link__main_menu
  menu_link

However, the variables don't seem to be passed by ref, and if I don't return any string, the links render out null. So, what should I do if I want to just append a custom class to the links and then render them just the default way?

I tried something like in template.php:

function MYTHEME_menu_link__menu_block($variables){
  $variables['element']['#attributes']['class'][] = 'my-class';
  return theme('menu_link__menu_block', $variables['element']['#original_link']);
}

but it causes fatal error.

Any help please?


texts: In View, there is this field called "Global: PHP". I wonder how I can use token in this field in Drupal 7.  I can easily use token in "Global: Custom text" but not in "Global: PHP"


texts: Taxonomy term empty fields in a ALL vocabulary

texts:
I have this "screen" when I click on "manage fields" for all of my taxonomy vocabularies (new included):

All these "fields" empty. And I have no these fields.


texts: How to run alter query to modify mysql database using hook_schema?

texts:
I want to change data-type of a field in for a particular table in database. I  want to use hook_schema_alter() to do so.
The ALTER query is:

ALTER TABLE `abcd` CHANGE `session_number` `session_number` INT( 255 ) NOT NULL COMMENT 'Session number to get number.'

Is it possible to implement such query using hook ? If yes please guide me.
Tonnes of thanx in advance.


texts: Newly Inserted Record was not Queried, Immediately after Insertion

texts:
I have a form element below:

//Calls a function that contains the html for templates table.
$form['myid_templates_editor_table_wrapper'] = array(
    '#type' => 'item',
    '#markup' => myid_create_templates_table(),
);

The function below, populates the element above with the HTML  of a table.

function myid_create_templates_table(){

    //Retrieve list of templates in the database
    $query = db_select('studidtemplates', 't1',array('target' => 'import'));

    $result = $query
        ->fields('t1', array('template_id', 'template_name', 'date_created', 'user_name'))
        ->orderBY('template_id', 'DESC')
        ->execute();

    $table_header = array(
        'template_id' => array('data' => 'Template ID' , 'field' => 'template_id','sort' => 'asc'),
        'template_name' => array('data' => t('Template Name'), 'field' => 'template_name','sort' => 'asc'),
        'date_created' => array('data' => 'Date Created' , 'field' => 'date_created','sort' => 'asc'),
        'user_name' => array('data' => t('Created by'), 'field' => 'user_name','sort' => 'asc'),
    );

    foreach ($result as $record) {
        $table_rows[] = array(l(t($record->template_id), $record->template_id, array('attributes' => array('class' => 'use-ajax'))), $record->template_name, $record->date_created, $record->user_name);
    }
    return '
' . theme('table', array('header' => $table_header, 'rows' => $table_rows)) . '
';
}

It looks like the image below:

Whenever a new record is inserted to the table, the function below renders the $form['myid_templates_editor_table_wrapper'] element to update it's table display.

function myid_save_templates_editor($form, &$form_state){
    global $user;

    $save = db_insert('studidtemplates',array('target' => 'import'))
        ->fields(array(
            'template_name' => 'WEW',
            'date_created' => date("Y-m-d H:i:s", time()),
            'user_name' => $user->name
        ))
        ->execute();

    return array(
        '#type' => 'ajax',
        '#commands' => array(
            ajax_command_replace('#myid_templates_editor_table_wrapper', render($form['myid_templates_editor_table_wrapper'])),

        )
    );
}

I notice something weird about it. When my actual record in the database is 1, the table displays 0 records. When my actual record is 2, my table displays 1 record. When my actual record is 3, it displays 2 records in my table and so on and so forth.

I was suspecting that my $form['myid_templates_editor_table_wrapper'] element was being rendered, even if db_insert has not yet successfully inserted a record in my database.

Now, the question is : How will I execute the rendering of my form element after db_insert had successfully inserted a record in my table?

UPDATE 1:

I tried Shabir A. 's  suggestion:

$save = db_insert('studidtemplates',array('target' => 'import'))
    ->fields(array(
        'template_name' => 'WEW',
        'date_created' => date("Y-m-d H:i:s", time()),
        'user_name' => $user->name
    ))
    ->execute();

watchdog('myid', $save);

if($save){
    return array(
        '#type' => 'ajax',
        '#commands' => array(
            ajax_command_replace('#myid_templates_editor_table_wrapper', render($form['myid_templates_editor_table_wrapper'])),
        )
    );
}

But the problem still occurs, When I view my watchdog table, the $save variable has a value of 371. That means it was inserted successfully, as what Shabir A. said, but the table display was not updated. Is there anything wrong with my query? Where am I missing?


texts: Webform submit buttons redirect to first page when clicked twice

texts: Hi I'm relatively new to Drupal 7 and I'm currently working with a multistep webform. I'm having a particular problem around the Previous/Next submit buttons which seem to work fine when clicked ones but when two clicks are performed on any of them with a second or two delay between the clicks (while the form is loading) they do not direct to the previous or next page (depending which button is clicked) but direct to the start of the form. Any idea on how to prevent this from happening. I have tried to disable the buttons (in the hook_form_alter()) after the first click and also tried to put some sort of delay but nothing seems to be successful. Any suggestions on this?


texts: New custom content type: place image above body

texts: I would like to create a content type in which an image is inserted after the title and before the body. When I add an image to the image field, that image is placed after the body...


texts:
I've created a custom entity which only should to be displayed on pages provided by the user.

To handle multiple pages, I've created a textarea where the user can enter a page per line. Just like the blocks module.

My problem here is that I don't know how to make the query that loads the correct entity by page.

My guess is that it should be something like this:

SELECT * FROM {my_entity} WHERE pages LIKE :path

However, that leads to the problem that 'node/1/edit' also loads the entity when the user has entered 'node/1'.

I know this functionality already exists somewhere in Drupal because it is used for blocks, but I can't find it in the code...


texts: new created zen subtheme - content offpositioned

texts:
I just created a new zen subtheme using drush. Everything went smooth but I think there is some kind of problem with css - #content container is completely off positioned from page. I did not make any changes to files. Is it some kind of bug or this needs some tweaking?
I have sass and compass installed. I use zen 7.x-5.5 version.
Please see screenshot.
Thank you.


texts: How can I create a Drupal/IFTTT trigger or action?

texts:
I am looking into the service IFTTT ("IF This Then That"), which is like a trigger/action for the internet. For example, I could tell it that IF I post a new image to flikr, THEN post a link to it on Facebook.

I am wondering if anyone has managed to integrate this into drupal, so, for example, I could automatically post across social media networks when I create new content on a drupal site.


texts:
I have a altered registration form with a check box that when checked adds few fields. The fields are wrapped in a specific div.

The callback function of check box is supposed to hide the dive when the check box is unchecked.

The adding works well but the unchecking doesn't. If I uncheck the checkbox the added fields remain there as nothing has happened. Checking it again doesn't change anything.

The weird thing is that the div is there (at least Firefox inspector sees it) and the callback function is probably fired as well (the POST is send).

I have even tried to debug it using dsm() but it doesn't show any message (no idea why).

    function fm_users_more_form_user_register_form_alter(&$form, &$form_state, $form_id) {

  $form['fm_first_in_firm'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show form.'),
    '#ajax' => array(
      'callback' => '_fm_ajax_new_firm_form',
      'wrapper' => 'firm-reg-container-div',
      'method' => 'replace',
      'effect' => 'fade',
    ),
  );

  $form['firm_registration_container'] = array(
    '#type' => 'hidden',
    '#attributes' => array('id' => array('firm-reg-container-div')),
  );
}

function _fm_ajax_new_firm_form($form, &$form_state) {
  if ($form['fm_first_in_firm']['#value'] == 1) {
    dsm('tst1');

    ...

    $firm_form = drupal_get_form('fm_firm_node_form', $node);

    $form_wrapped = array(
      '#prefix' => '
',
      '#suffix' => '
',
    );

    $form_wrapped['register_form'] = $firm_form;
    return $form_wrapped;
  }
  else {
    dsm('tst2');
    return array(
      '#type' => 'hidden',
      '#attributes' => array('id' => array('firm-reg-container-div')),
    );
  }
}


texts: How to hide a menu item of a view for an administrator?

texts:
I have created a view with Views and restricted the access by Role. I also created a menu with the view, and I didn't select the Administrator role to be included (so Administrator role does not have access to that view). But the view's menu item is still showing to the Administrator.

How can I hide that menu item for Administrators?

Notes:

This also happens for a user with a uid which is NOT user/1.
The menu item is shown, but the administrator can't actually access the actual views results.


texts: How to I trigger Xdebug 3.x with Drush in PHPStorm

texts:
Has anyone has success with getting CLI debugging (drush) working with Xdebug 3.x?
There are several obsolete posts here... but all obsolete with the new version of Xdebug.
Expected behavior
After setting a breakpoint in a PHP class or module, that I know is executed when a specific Drush command is run, I would like PHPStorm to stop at the breakpoint.
Debugging when initiated from the browser works beautifully.
Drush - nothing.
Though it used to before I;

upgraded to Catalina
upgraded Xdebug from 2.x to 3.x

Environment:
Local MAMP Drupal 8 / Drush 9.7.2
PHP
PHP 7.4.13 (cli) (built: Nov 30 2020 14:46:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies


texts: Adding new paragraphs without altering translation with Lingotek

texts:
I'm having problems while translating with Lingotek, if I want to touch any translation to fix it's fine, but when I add a new paragraph for it to be on the translated page it needs to be "re-translated" which removes the translation I fixed. Only happens when I add a new paragraph I'm able to individually work on each paragraph if they are already added.

Am I doing something wrong? Does someone have experience circunventing this issue or is there any other module that is better suited for what I want to do?

Thanks.


texts: Wave tool used to evaluate web content for accessibility issues giving Broken ARIA reference errors

texts:
I am trying to fix Broken ARIA reference errors notified by Wave tool in chrome for my custom module web pages and Drupal 8 core login form. Sample error in login form is mentioned below for username field. How to fix these issues. For every user control I have this site wide.

Error at username text box:

*aria-describedby="edit-name--description", aria-required="true"

(An aria-labelledby or aria-describedby reference exists, but the target for the reference does not exist.)

I am not able to find aria-describedby attribute itself in the code for the controls. So, I am not sure how to fix them.


texts: How can I update existing config from a custom module's config/install yamls?

texts:
I added some config yml files to my module's config/install directory so that it is installed directly when installing my module, it works well only if there isn't a config file with the same name installed already and only if it's the first install.
  So my question is there a way to update the config files already installed with my module's config file, and delete them when uninstalling the module ?


texts:
In Drupal, we can create nodes with the core module "RESTful Web Services". There is a lot of documentation about creating one node with one request, the Drupal documentation provides the following example:

curl --include \
  --request POST \
  --user klausi:secret \
  --header 'Content-type: application/hal+json' \
  --header 'X-CSRF-Token: <obtained from http://example.com/rest/session/token>' \
  http://example.com/entity/node?_format=hal_json \
  --data-binary '{"_links":{"type":{"href":"http://example.com/rest/type/node/article"}},"title":[{"value":"Example node title"}],"type":[{"target_id":"article"}]}'

We want to import 25.000 nodes on a regular basis and worry that this could take really long if we use a separate request for each node.

It should be possible to send a list of nodes. Drupal's REST web service uses the Serializer Component from the Symphony framework. The Symphony docs say that it includes the serialization of lists of nodes. Passing a list to the REST web service should simply look like this.

curl --include \
  --request POST \
  --user klausi:secret \
  --header 'Content-type: application/hal+json' \
  --header 'X-CSRF-Token: <obtained from http://example.com/rest/session/token>' \
  http://example.com/entity/node?_format=hal_json \
  --data-binary '[{"title":[{"value":"Title 1"}],"type":[{"target_id":"article"}]},{"title":[{"value":"Title 2"}],"type":[{"target_id":"article"}]}]'

When I send this data, I get this response.

  Could not determine entity type bundle: type field is missing.

t seems that the serializer does not recognize that I send a list.

What is the correct way to send a node list to the REST API?


texts: Can't find file to patch at input line 11, File to patch:?

texts:
I got an error message on module installation simpletest

  SimpleTest could not be installed. Must apply core patch, please see INSTALL.txt. (Currently using SimpleTest code addition Not-found)

Then by the instruction provided by INSTALL.txt I run the command

  ioss@ioss-System-Product-Name:~$ patch -p0 < /var/www/Drupal/beeone/sites/all/modules/simpletest/D6-core-simpletest.patch

Then I got error below

can't find file to patch at input line 11
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|? sites/all/modules
|? sites/default/files
|? sites/default/settings.php
|Index: install.php
|===================================================================
|RCS file: /cvs/drupal/drupal/install.php,v
|retrieving revision 1.113.2.12
|diff -u -p -r1.113.2.12 install.php
|--- install.php    9 May 2010 14:13:31 -0000   1.113.2.12
|+++ install.php    7 Oct 2010 21:55:51 -0000
--------------------------
File to patch:


texts: How do I unset the comment form in Drupal 7?

texts:
In Drupal 7, the comment form appears on every node. I want to unset the comment form and display a link of "Add new comment" that will display the comment form on click.

Do you have any Idea?


texts: How to remove default divs on views result?

texts:
I'm trying to add use bootstrap modal and bootstrap slideshow to show a view but the slideshow doesn't work the way I want it because of the default generated divs by Views module. Here is the code:

heading 1

This is the description.

heading 2

This is the description.

I want the result of the view supposedly like this:

heading 1

This is the description.

heading 2

This is the description.

Only the output of the view with no views default generated divs.


texts: Drupal as (powerful) relational database

texts:
I’d like to make a Drupalsite, providing a platform for people around the world who are working on the same research topic to collaborate and communicate. (I’m sure Drupal is therefore an excellent choice).

However, this website should also include a relational database (which will be a very interesting research tool for the visitors of the website).  A test version of this database already exists in ooo base: it has 50 tables with a lot of many-to-many and one-to-many relations between them. Very basically it records the relations between persons, events and organisations.

I know it’s possible to create a relational database in drupal by creating custom contenttypes and by using the entity connect module. However, having a look at the way Drupal stores these data in its mysql database, I’m afraid this way of building a database isn’t very useful for me, as it seems very difficult to query the data (or to use [social network] analysis software on them). The possibility of querying the data easily, is crucial for my database.

I know it’s possible to add a second database to the drupal site (cf http://drupal.org/node/18429).  However, I’m not sure whether that’s the solution for my problem.

Very short I’d like to know:

(1) Whether it’s possible to change the way Drupal saves the data of some content-types in its mysql database, to a way which seems more “natural” for analyzing data (and being able to query them easily)

(2) Whether it’s possible to add a second mysqldatabase to the drupal site, which organizes the data of some content-types on a custom (more ‘natural’) way. If possible, the users of the drupal site have to be able to add content and to analyze these data, as if they were saved in the same database.

I’d be very thankful if someone could help me!


texts: How do I allow users to select published content on the site to be displayed on their profile page?

texts:
I would like to have published content on my site which a user can select if he/she would like for it to be displayed within a block on their profile page.

For instance:

Published content is an article with image and body,
When the user is viewing this node there is a checkbox (or whatever that will work) that will say "Add To Profile".
If selected, then the content teaser will appear within a block on that specific users profile page.

I know how to get content that is created by a user to appear on that users profile, but I have been having difficulty getting this right.

PS: I know very little php, but know my way around Drupal.


texts: Paragraph type can't delete individual items

texts:
I use Paragraph module Version: 8.x-1.5. Somehow I can't delete individual items anymore?

Is there a settings somewhere I missed?


texts: As documented here, there are some global variables defined by Drupal. How can I access them in twig?


texts: Using git to fetch changes from testing version to live website

texts:
I am maintaining and developing a Drupal website and have a testing/development version of the site in a subfolder of drupal instalation. I started to learn git and I am wondering about how could I use it in my development process. I came up with following solution:

Make a git repository for live site and clone it in the test subfolder (which will be added into live site's .gitignore file). Make some development in the test directory, test it and when I'm satisfied, switch to the live site repository, fetch and merge the changes.

Since I am a newbie to git, I'd like to know if this approach can be succesfully used, or if not, which aspects should I change/or come up with completely different solution.


texts: Most efficient way to change CSS between pages

texts:
I'm looking to change certain parts of my design for my site through the CSS, my basic principle is that when you navigate to a certain page, it will kick in to effect, and change some CSS values.

Say for example you navigate to mysite.com/colour/red. It would change certain parts of the styling to red (like border colours, underlines, link colours etc) and it would remain in red until you then navigated to something like mysite.com/colour/green at which point, everything that had previously changed to red, now becomes green.

I have already written some code which runs a function when you navigate to one of these pages and sets a session variable using the Session Cache API so that I can set a temporary colour change for the site.

My question is, what is the best way of injecting the new lines of CSS into my site at this point? My initial train of thought is that I can extend the function I currently have to pull in an external CSS file with those specific colours already defined (ie if you go to mysite.com/colour/red, it will pull in red.css, with the border/underline already specified). Or alternatively, I have thought about using the html.tpl file to perform a check against the session parameter, and pull in a CSS file through there.

What would be the most efficient way of changing my stylesheet? Is there a function already in Drupal which would allow me to do something like this

NB. I am using the Alphorn Omega theme template


texts: Unpublish article based on non date type field

texts: So, I know that you need Rules to unpublish articles (after a certain time) based on date fields (https://groups.drupal.org/node/240678#comment-782543). But is this also possible with non date fields? When the user creates an article there should be a select list with items like 1 month, 3 months, 6 months. After submitting the article is saved as unpublished, it is moderated and published by an admin and should then automatically be unpublished after the period selected by the user.


texts: How to use a relative path for a theme's favicon

texts:
I'm trying to ship a favicon with my custom Drupal 8 theme, but I can't figure out how to specify its location relative to my theme's installation location.

Following this answer I've created a config/install/MY_THEME.settings.yml file containing

favicon:
  use_default: false
  path: '/themes/MY_THEME/static/favicon.png'

(I'm keeping all my theme's static files in a static subdirectory of my theme directory)

This works, but contains a hard-coded reference to the installation location of my theme. Hence, if a user decides to install the theme in themes/contrib or themes/custom instead of in themes the favicon won't be found.

Therefore I would like to specify a path relative to my theme's root directory or relative to the MY_THEME.settings.yml file. However, it seems that Drupal uses the server root (/) as a base when I specify a relative path, so static/favicon.ico ends up as /static/favicon.ico which obviously doesn't work.


texts: Programmatically get webform submitted field values

texts:
How can i print/echo the submitted value of specific field in from a webform? I need to do this in the webform 2 PDF module so i can better customize the output of generated PDFs. Im fairly new to Drupal so an example of how to get a simple f_name filed would be great.

I'd also like to start getting more involved with the Webform API too.

i.e

First Name: SUBMITTED NAME VALUE


texts: Omega Subthemes, Modernizr, and Javascript placement

texts:
I am embarking on a new project and have decided to use Omega as as my base theme.  I have a few related questions to overriding html.tpl.php in my subtheme.

I normally use Modernizr for HTML5 feature detection and to provide the HTML5 Shiv functionality.  Are there any problems with replacing the conditional HTML5 Shiv with always including Modernizr?  Are any of the features incompatible with the Javascript that Omega provides (like the Media Queries extra)?

Second, I normally place Javascript at the bottom of the page.  Will this interfere with any of the JS that Omega relies on?


texts: User Import module's "Send email" option is not reported in system log

texts:
When importing batches of users as .csv files, the module's option "send email" appears to be working inconsistently. Some users receive the email, others don't and can't find it in Spam. Repeating the import doesn't always solve the problem.
In addition to the mystery of this inconsistency, the email send-out by the module does not show up in the system log, whether successful or not. Therefore there is no way to verify if it was sent, except to depend on the user's report of receiving or not receiving it. (Other kinds of email sends are recorded in the log; for example one that we set up in Rules.) Is there a solution for addressing this?


texts:
Can anyone help me to make multipage form not multistep.
Suppose On front page i have two fields select service and select location and a button and after selecting both clicking on button opens a new form on new page.


texts: Use background images without knowing programming?

texts:
I'm trying to set up a site using Drupal 7, and have very little knowledge of the stuff under the hood.  If the answer is to edit some css, please give VERY simple instructions.

Is there a simple way to put background images in the Acquia Marina theme?

Or, are there similar looking themes that have this facility built in?

Thanks!


texts: Why authenticate request returned 403 after successful login?

texts:
I have front-end with AngularJS and its connected to drupal backend. I am using drupal services module for rest api.
I have an angularjs web app in subdomain [admin.example.com].
My authentication subdomain [account.example.com] developed with drupal 7.
I can login successfully to account.example.com from admin.example.com using http request from angularjs, so I stored newly generated token. But when i try to collect user data from [account.example.com] using previously stored token, i get 403 status. I'm sure my token is correct.
This work well with chrome disable-web-security mode, when i try from regular mode its response me 403. but i did not get any cors error.
Someone please help me, i'm stack on this stage...
My Apache Conf file [account.example.com]:

<VirtualHost *:80>
    ServerName account.example.com
    ServerAlias account.example.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/example_account

    <Directory "/var/www/example_account">
        AllowOverride All
        Require all granted
        Header always set Access-Control-Allow-Origin "*"
        Header always set Access-Control-Allow-Headers "Content-Type, Accept, Authorization, X-CSRF-Token"
        Header always set Access-Control-Allow-Methods "GET,POST"
        Header always set Access-Control-Allow-Credentials true
    </Directory>

        #RewriteEngine On
        #RewriteCond %{REQUEST_METHOD} OPTIONS
        #RewriteRule ^(.*)$ $1 [R=200,L]

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Here is header requests:


texts: drupal remove individual paragraph tags of the tokens of my replacement patterns in a View

texts:
I want to rewrite results in a View and use replacement patterns to do this. The problem is that when I do this the 2 tokens are displayed in a separate paragraph.

--> [views_conditional][field_blg_inhoud]

What I have now:
Views_conditional text

Field_blg_inhoud text

What I want:
Views_conditional text Field_blg_inhoud text

I think I have to change a lot in my standaard CSS etc. but isn't there an easier way? Can I somehow ignore the   somehow?


texts:
Is there a way to list or get all the Drupal 8 core templates which are being used by a site? The list should exclude the templates coming from the theme.

The method I am using is enabling Twig debugging in the services.yml and checking whether a template is from core using a browser's inspector, but this is tedious.


texts:
I am using drupal7 and the admin menu overlay (in seven). And I'm always apalled by the primary tabs appearing in view mode. They are messing up the layout for the editors / admins, and they're usually not in style with either the site design or the overlay design.

I was just wondering .. is there a pretty way to move the primary tabs ('edit' et al) to the admin overlay shortcuts bar - 'if the overlay is visible and you are in view mode'

Perhaps there are two answers:

remove the primary tabs from the content, if the overlay is visible and you are in view mode
add the primary tabs to the shortcuts bar,    if you are in view mode

Any hints ?

*-pike


texts: Loop over entity reference view for email using Business Rules

texts:
I have an entity reference built to show user name, email and last access.  This works fine and shows data in the view.  I am attaching this to a Business Rules module action so that I can loop over members of a role to email them all.

I have the first action which does the loop and second displaying a message to validate.  The problem is the email field will note render correctly.  Here is syntax

{{action_name->name}} - {{action_name->mail}}

These variables should be available.   The "name" will render correctly but email does not.


texts: Add drop down selection to shipping method

texts:
I need to add an additional drop down field when a particular shipping method is selected, on the order information page during checkout. I only found how to add additional plugin option when adding a new shipping method through the UI.
This is for a custom omniva parcel machine location implementation. Can anyone help me out where to get started with this?
EDIT: im using drupal 8 and commerce 2.
UPDATE: i tried creating a custom pane, thanks to the suggestion of Berry Dingle. I added the drop down and managed to pass the value to the summary page but i can't figure out how to get the value in the email receipt.
I saved the selected value like this but how can i access it in the email template?
This is how i saved the value.
$form = $form_state->getValue($pane_form['#parents']);
$val = $pane_form['omniva_parcel_machines']['#options'][$form['omniva_parcel_machines']];
$this->order->setData('omniva_parcel_machines', $val);

This is how i built the summary pane.
public function buildPaneSummary()
{
    if ($parcel_machine = $this->order->getData('omniva_parcel_machines')) {
        return [
            '#plain_text' => $parcel_machine,
        ];
    }
    return [];
}

Is it even possible to access the value in the email receipt twig template or i have to pass it somehow?
I tried using
{{ order_entity.getData('omniva_parcel_machines') }}

as well as
{{ order_item.getData('omniva_parcel_machines') }}

but so far nothing.