texts: After any AJAX form event, all Entity Reference Fields are blank

texts:
After any AJAX event in the form (Upload image, add a new field collection row etc.) All Entity Reference fields go blank.

I have multiple entity reference fields, all using a view to get list options.

The issue is occurring on the node edit form.

On first page load, all entity form values are there, and you can edit and save them with no problems. However, If you edit any field that uses AJAX to update, then after ajax has run, all of the entity reference fields lose their options and only show "None" as the single option.

Can anyone think why this would be happening, and what steps I can take to either provide more info, or find a fix?

After using an AJAX field, and then trying to save the form, I get this error in watchdog,

TYPE    form
DATE    Tuesday, 21 June, 2016 - 08:47
USER    collins
LOCATION    http://couplespage.com/node/23/edit
REFERRER    http://couplespage.com/node/23/edit
MESSAGE Illegal choice 7 in Venue element.
SEVERITY    error

This obviously happens because the select lists are all empty, and illegal choices are detected.

http://tinypic.com/r/2pod2dy/9

Update:
On further inspection, using dsm($form) to print krumo and check the results, after ajax, it takes over a minute to complete the page, but all of the values are still there in the array, just not in the actual select list. They are also still there in the page source. Something is making them not show. I will look into someway to rebuild the form after ajax, but Im grabbing at straws here.
Any help really appreciated.

Update 2:
On even further inspection. Values are only lost when it is a view Entity Reference display that is being used to populate the values. When reverting to a simple filter by bundle list, they show after ajax. Something is causing the view to lose its results after ajax.


texts: How to add a option in wysiwyg editor so that blocks can be selected as images?

texts: Using the Wysiwyg module, we are able to add an image. Is there any way so that I am able to view my blocks in it as well as assign those blocks in any place inside a page?


texts: Cache tags for all entities of a certain type

texts: I understand how you can add cache tags to a custom query for a particular entity id (or list of them) but is there a way to add cache tags that will invalidate a query if any entity of type FOO is updated/added/deleted?


texts: How to make get for drupal behaviors to run only once?

texts:
Drupal.behaviors.js_mod = {
attach: function (context, settings) {
     //$('body', context).append(chart);
    // $( '#drupal-myradar', context ).once
     $.get( "/web/js/mod", function( data ) {
        console.log(data);
      });
}

    }
})(jQuery, Drupal, drupalSettings);

Essentially this code is running multiple times while grabbing information from my controller code. I only want this to print out once to the console when the page is loaded.


texts:
I'm using entity print module and wkhtmltopdf library.
Even though I've checked the create table of contents on the configuration, I don't know how to do that. I've created h1, h2 and h3 but the TOC is nit there.
So anybody know how to do it?

Also is there any way I can control the pages? I mean, I need to add an image only on the first page, and a footer on the other pages. I know wkhtmltopdf has this feaure, but I don't know how to solve it in drupal


texts: Views template- how can I still use "hide if empty" behavior with my custom template?

texts:
I want to customize the output of a field on my site so I made a custom views template.  Here's the code:

<?php foreach ($row->field_field_location_taxonomize_terms as $data): ?>

  <?php if ($data['rendered']['#markup'] == 'Unknown'): ?>
  <?php elseif ($data['rendered']['#markup'] == 'United States of America (USA)'): ?>
    <?php print 'USA'; ?>
  <?php elseif ($data['rendered']['#markup'] == 'United Kingdom (UK)'): ?>
    <?php print 'UK'; ?>
  <?php else: ?>
    <?php print $data['rendered']['#markup']; ?>
  <?php endif; ?>

<?php endforeach; ?>

As far as editing the output, this works fine.  However, if the field is empty, the Label (set in views) for the field will still be printed, even though I have Hide if empty checked under No Results Behavior.  If I remove my custom template, then the label is hidden when there is no value, so there must be something wrong with my template.  Any ideas?


texts:
I am looking to download and install a module using the Linux command line.

How can I do this?


texts: Search on field collection with EntityFieldQuery

texts:
I have a node resource with fields

  name
  files (field collection)

And field collection with fields

  title
  path

How can I search all node have file title = 'example'

How can I do it don't use view. Can we use EntityFieldQuery?


texts: Creation of users and see list of the user created by a specific roles like?

texts:
I have three kind of role business manager,gen manager and handler.
Business manager can create an account for gen manager and activation will done automatically.

My requirement is that How can Business managers see the list of created gen manager  when business manager will login with its account in site.

gen manager can create an account for handler and activation will done automatically.

My requirement is that How can gen managers see the list of created handler  when gen manager will login with its account in site.


texts: How to determine what image style an image field of a node has?

texts: In D7, is there a way to get an image style assigned to an image field? if I have created an image style, say, my_image_style by overriding a default image style (thumbnail, medium or large at /admin/config/media/image-styles) and then assigned it to a field_image of a node at /admin/structure/types/manage/article/display, how can I programmatically determine what style does field_image have?


texts: Conflict between ajax callback and jQuery UI dialog

texts:
I have a button that triggers an AJAX callback with the form api like so :

$form['show_modal'] = array(
 '#type' => 'submit',
 '#value' => t('Some crazy text'),
 '#ajax' => array(
     'callback' => 'myCallback',
     'wrapper' => 'myWrapper',
 ),
 '#suffix' => '</div>',
);

I then do some stuff and return my new form and display it (working).

 return $form['myNewForm'];

I want to display it in a custom jQueryUI dialog,
but when I do that my AJAX callback doesn't work anymore ...

 //On click, open modal
 $('#showModale').click(function(){$('#myWrapper').dialog("open");});
 //Modal itself
 $("#myWrapper").dialog({
  autoOpen: false,
  show: {
    effect: "blind",
    duration: 300
  },
  hide: {
    effect: "blind",
    duration: 300
  },
  height: 400,
  width: 1000,
  modal: true,
  resizable: false,
  draggable: false,
});

Any ideas about it ?


texts: How to use a webform key more than once.

texts: We are using webform and on submit sending the result to an API. We have a drop down that loads on context. We need use form_key twice, one for each dropdown but Drupal will now allow us to, is there a way to use form_key on two fields?


texts: Logo size should not reduce after uploading - Drupal 7

texts:
I have had uploaded a logo in my site.

After uploading the image's size is reduced. Because of that, image quality is decreased and it doesn't look good.

What should I need to do TO NOT REDUCE THE SIZE OF THE LOGO after uploading.

I'm uploading via admin/appearance/settings/theme_name and using "Upload logo image" option

In admin/config/media/image-toolkit the JPEG quality is 75%. I made it 100%, still it doesn't work.

Any suggestions or advices will be helpful...


texts: Module listing page leading to php timeout

texts:
I am noticing that when I open the Modules listing page - admin/modules/ it leads to php timeout.
There was no problem in listing out all the modules with drush. On opening the Modules listing Form in the core.
\Drupal\system\Form\ModulesListForm

I traced the problem to the following loop in the form.
$form['modules']['#tree'] = TRUE;
foreach ($modules as $filename => $module) {
  if (empty($module->info['hidden'])) {
    $package = $module->info['package'];
    $form['modules'][$package][$filename] = $this->buildRow($modules, $module, $distribution);
    $form['modules'][$package][$filename]['#parents'] = ['modules', $filename];

  }
}

If I do a break; the page loads up correctly with just one module and no errors. I believe its due to the sheer number of modules and the data that needs to be processed before generating the page.
So there is no bug but simply due to the data size in the loop. Has anyone faced this issue before  and know how to speed up things?
P.S I am using the lightning installation profile.


texts: Can I add a template preprocessor that's more specific than an existing hook?

texts: I have a preprocessor function in my model that runs on the views_view_table hook. I want it to be called only for a specific view. If it were a hook, rather than a preprocessor, I could use, for example views_view_table__myview. Can I do that with just the preprocessor, too, or do I have to register a matching hook? If so, how do I make sure it does exactly what the base hook does?


texts:
How do i programmatically change a field's 'Widget' property under 'Manage Form Display' & a fields 'Format' property under Manage Display?

Manage Form Display:

I'd want to programmatically change the Birthdate field's 'widget' property to 'Textfield' to make it visible on forms when my module is installed/enabled.

Manage Display:

I'd want to programmatically change the Birthdate field's 'format' property to 'Plain Text' to make it visible on forms when my module is installed/enabled.


texts:
I keep having a 404 error no matter what I change on my routing file.

I've created a module in modules\custom which have :

An info file in modules\custom\first_module\first_module.info.yml:

name: First module
core: 8.x
type: module
package: Training modules
description: First Module created to learn coding in D8

A Routing file in  modules\custom\first_module\first_module.routing.yml:

first_module_hello_world:
  path: '/hello-world'
  defaults:
    _controller: '\Drupal\first_module\src\Controller\TrainingModule:helloWorld'
  requirements:
    _permission: 'access content'

A controller in modules\custom\first_module\first_module.routing.yml:

<?php
/**
 * @file
 * Contains \Drupal\hello_world\Controller\HelloWorldController.
 */

namespace Drupal\first_module\src\Controller;
use Drupal\Core\Controller\ControllerBase;

/**
 * Controller routines for hello_world module routes.
 */
class TrainingModuleController extends ControllerBase {

 /**
  * Return the 'Hello World' page.
  *
  * @return string
  *   A render array containing our 'Hello World' page content.
  */
 public function helloWorld() {
  $output = array();

  $output['hello_world'] = array(
    '#markup' => $this->t('Hello World!'),
  );
  return $output;
 }
}

Any help would be greatly appreciated !

Edit: The Module is activated and I cleared the cache several times.


texts: Token replacement by its value before indexing in apachesolr

texts:
I'm using solr 4-x (apachesolr) for search functionality in my Drupal 7 site. I'm using a token in some long text fields in some nodes of different content types across my site. Lets suppose the token is [token_name] and its value is "test". So, whenever I search "test", the nodes containing this token don't show in search results. But when I search [token_name], the concerned nodes show in the search results.

What is happening here is that instead of the original token value, the [token_name] is stored in database. So, for indexing, the [token_name] is getting indexed instead of its value. And hence, it is unable to show results related to "test" as search keyword. Is there anyway to do this? Please suggest as I need to fix this ASAP.

P.S. I can't replace [token_name] by its value while saving the node by hook_node_presave.


texts: search-api solr is nor performing OR search

texts:
I am trying  to provide the OR feature for my solr search . when user type words, the search should be able to return result which matches with any word present in the query .
I changed the default operator from AND to OR in my schema.xml ,
After change it looks :<solrQueryParser defaultOperator="OR"/>
however , It still doesn't perform OR search . The result is empty when I type multiple words .
I am using search_api with solr  I have aplplied the changes to my drupal solr configuration as well as solr server .what could be wrong ? any pointers is really appreciated
Thanks


texts:
I'm trying to make a Drupal 8 theme and no matter what I do, the stylesheet I have won't render. Here's my libraries.yml file:

global-styling:
version: VERSION
css:
theme:
  css/layout.css: {}

and here's my info.yml file:

name: My Test Blog
type: theme
description: 'My test theme description'
package: Custom
core: 8.x
libraries:
  - MyTestBlog/global-styling
stylesheets-remove:
  - '@classy/css/layout.css'
  - core/assets/vendor/normalize-css/normalize.css

regions:
  header: Header
  content: Content
  stylesheets:
    all:
        - css/style.css

Any ideas?


texts:
Here is what i get in views:

(first-row)
node1title
node1body

(second-row)
node2title
node2body

and this is what i want:

(first-row)
node1title
node2title

(node2-row)
node1body
node2body

is it possible to get it in a single view?


texts: Drupal menu calling variables in the template

texts:
When I use these functions it gives me a permanent redirect error on the code whereas when I use other page callback it does not give me any problems.

    function kbc_menu() {

     $items['hello3'] = array(
     'title' =>'Hello World!',
      'page callback' =>'mypage',
      'type' => MENU_NORMAL_ITEM,

    );
    }

function mypage() {
   $asdas ="asdasd";
  return theme('my_custom_template', array('out'=>$asdas));
}

function kbc_theme() {
  return array(
      'my_custom_template' => array(
        'template' => 'view-location',

      ),
   );
}


texts:
I have to create a menu that includes items in a variety of languages including Arabic and Farsi.

Something like this:

-LTR item
-LTR item
 RTL item -
-LTR item
 RTL item -

Is there a way to add the dir='rtl' to specific menu items?

And more importantly, is there a way for me to make this accessible to non-technical users that will be maintaining the site after I have created it?

The site is being built in Drupal 8

Ideas?


texts: How do I provide a page manager page override for my custom entities using ctools plugins

texts:
I have a custom entity type implemented, this is essentially identical to what the Model module provides, with extra integrations.

I'm wanting to use panels and page manager to template my entity pages, much like how page manager provides the node_view which overrides the node/%node path, I want to override my custom entity paths.

What ctools plugins and hooks do I need to implement to gain this functionality?


texts: Views: Computing user's age "on the fly"

texts:
Is there a way to compute the age of a user on the fly in the "rewrite result" section of a date field?

I am trying to avoid computed field and having to use cron on that one. What I would like to achieve is having the age calculated and displayed on the fly in a date field (date of birth) included in a view.

Any and all input on this will be greatly appreciated. Thank you. :)


texts: rest namespace not recoginzed in custom REST API class

texts:
I'm working on creating my first custom REST resource in D8, and following this blog post, I have the following class in the /modules/custom/video_export/src/Plugin/rest/resource directory:

<?php
/**
 * @file
 * Custom Rest resource for video nodes.
 */

namespace Drupal\video_export\Plugin\rest\resource;

use Drupal\rest\Plugin\ResourceBase;
use Drupal\rest\ResourceResponse;
use Drupal\Core\Session\AccountProxyInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Psr\Log\LoggerInterface;

/**
 * Provides a resource for database watchdog log entries.
 *
 * @RestResource(
 *   id = "video_export_source",
 *   label = @Translation("Video Export Source"),
 *   uri_paths = {
 *     "canonical" = "/videos/feed/{site}"
 *   }
 * )
 */

class VideoExportResource extends ResourceBase {
  /**
   *  A curent user instance.
   *
   * @var \Drupal\Core\Session\AccountProxyInterface
   */
  protected $currentUser;

  /**
    * @param array $configuration
    *   A configuration array containing information about the plugin instance.
    * @param string $plugin_id
    *   The plugin_id for the plugin instance.
    * @param mixed $plugin_definition
    *   The plugin implementation definition.
    * @param array $serializer_formats
    *   The available serialization formats.
    * @param \Psr\Log\LoggerInterface $logger
    *   A logger instance.
    * @param \Drupal\Core\Session\AccountProxyInterface $current_user
    *   A current user instance.
  */
  public function __construct(
    array $configuration,
    $plugin_id,
    $plugin_definition,
    array $serializer_formats,
    LoggerInterface $logger,
    AccountProxyInterface $current_user) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger);

    $this->currentUser = $current_user;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      $container->getParameter('serializer.formats'),
      $container->get('logger.factory')->get('rest'),
      $container->get('current_user')
    );
  }

  /**
    * Responds to GET requests.
    *
    * Returns a list of video nodes to be imported into the target site.
    *
    * @return \Drupal\rest\ResourceResponse
    *   The response containing a list of bundle names.
    *
    * @throws \Symfony\Component\HttpKernel\Exception\HttpException
 */
  public function get($site = NULL) {
    $response = ['message' => 'Hello, this is a rest service'];
    return new ResourceResponse($response);
  }
}

However, I'm having multiple problems trying to use this code:

First, my IDE (PHPStorm) is not recognizing the namespace keyword. In addition, in my the rest dir in that path is highlighted in red, and it shows an error message on the resource keyword that says

  Undefined constant resource: declaration of referenced constant is not
  found in built-in library and project files.

I've verified that I have the RESTful Web Services module enabled.

Also, I have the REST UI module enabled, and it lists my resource, but when I try to enable it, it tells me undefined namespace Drupal\video_export\Plugin\rest\resource', which I'm sure is because of the other errors.

I've looked this over and over and can't see what's wrong


texts: Has anyone successfully exported content from the Paragraphs Modules via UUID Features?

texts:
I know this functionality isn't supported by default. I found the following patches and applied them, but still not luck.

Add UUID module support
Add Paragraphs module support

Is there another way to deploy content from paragraphs across environments? Feeds maybe?


texts: PHP fatal error on server after deactivating modules

texts:
Today our site went down with only white pages showing. The logs from the nginx server looks like this:

[01-Sep-2016 10:33:15] WARNING: [pool www0] child 26970 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class 'MigrateSimpleFieldHandler' not found in /srv/www/mysite/public_html/sites/all/modules/entityreference/entityreference.migrate.inc on line 18"
[01-Sep-2016 10:33:15] WARNING: [pool www0] child 26970 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class 'MigrateUIWizard' not found in /srv/www/mysite/public_html/sites/all/modules/migrate_d2d/migrate_d2d_ui/migrate_d2d_ui.migrate.inc on line 18"
[01-Sep-2016 10:33:20] WARNING: [pool www1] child 26712 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class name must be a valid object or a string in /srv/www/mysite/public_html/includes/common.inc on line 8026"
[01-Sep-2016 10:33:24] WARNING: [pool www1] child 26710 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class name must be a valid object or a string in /srv/www/mysite/public_html/includes/common.inc on line 8026"
[01-Sep-2016 10:34:27] WARNING: [pool www1] child 27190 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class name must be a valid object or a string in /srv/www/mysite/public_html/includes/common.inc on line 8026"
[01-Sep-2016 10:34:40] WARNING: [pool www1] child 26712 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class name must be a valid object or a string in /srv/www/mysite/public_html/includes/common.inc on line 8026"
[01-Sep-2016 10:34:56] WARNING: [pool www0] child 23319 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Class name must be a valid object or a string in /srv/www/mysite/public_html/includes/common.inc on line 8026"

This happens as soon as I try to update the database, I also get a "502 Bad Gateway" message from the server just before the screen turns white.

Should I activate the deactivated modules again or uninstall them?

EDITED: I can also mention that according to the status report there are database updates waiting to be run, but when I do that locally (wamp) I get the message that no database update is required. When I try to do this db update on the web server (nginx) I get 502 bad gateway error and then the pages go blank.


texts: How to reply to a comment through services in Drupal 7?

texts:
I am using Drupal 7 as back-end for a mobile application. I am using comments in my application.

Can anyone help me to reply to comment through web-service?


texts: Can't add custom CSS file to specific admin pages

texts:
So I want to add a CSS file to the node create/edit forms. My code is:
function general_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  if (in_array($form_id, ['node_article_edit_form', 'node_article_form']) {
    $form['#attached']['library'][] = 'general/general_library';
  }
}

My library file:
general_library:
  version: 1.x
  css:
    theme:
      assets/css/admin-styles.css: {}

And the general folder structure is:
general/
├── assets/
│   ├── css/
│        └── admin-styles.css

I rebuilt the caches, the modules is enabled and working, but the CSS file never shows up in the HTML.
What am I doing wrong?


texts:
At admin/config/regional/language/configure there are several options:

URL   - Determine the language from the URL
Session   - Determine the language from a request/session parameter.
User  -  Follow the user's language preference.
Browser -     Determine the language from the browser's language settings.
Default   - Use the default site language (English).

I don't want to use a language prefix or even different domains. I just want a very flat URL structure.

So I want the language to mainly depend on the current node. Is there a way to do that?

I want to avoid node translation. So each node will only be in one language only.


texts: Views aggregation for taxonomy based results in views working

texts:
I have created a view which lists contacts and groups them by office. However some contacts show up multiple times (I'd assume that is since some use taxonomy for their job titles, and some have more than one job title – but then I noticed even those with a single job role show up more than once so it's kind of random). Each contact only have one office connected to them.
Aggregated count distinct shows exactly the same items side by side still.
Distinct works for some of them, not in combination with aggregation though so that doesn't help.
I tried creating a taxonomy based view instead since I read that would be better suited, but the issue is exactly the same.
This is very frustrating, I've searched for hours now without any result sadly.
If there is any tutorial I've missed or general suggestion I'd be very grateful, I'm at a total loss since it seems like the functionality in views is kind of broken(?).


texts:
I want to use Javascript Custom Forms (JCF) to get more attractive and consistent looking forms on my Drupal 7 site. I've got it working to a degree, however when the form changes with AJAX, the new form element does not have the JCF styling applied.

(E.g. if you have a form file upload, and you press the 'Remove' button, the form changes, without reloading the page, replacing the Remove button with the Browse and Upload buttons. But the JCF styling is not applied to these new buttons.)

This is what I have so far...

In the theme .info file:

stylesheets[all][] = jcf/dist/css/theme-minimal/jcf.css
scripts[] = jcf/dist/js/jcf.js
scripts[] = jcf/dist/js/jcf.file.js
scripts[] = jcf/dist/js/jcf.radio.js
scripts[] = jcf/dist/js/jcf.button.js
scripts[] = jcf/dist/js/jcf.select.js
scripts[] = jcf/dist/js/jcf.checkbox.js

In the theme .js file:

(function ($) {
    $(document).ready(function(){
        jcf.replaceAll();
     });
}(jQuery));

I need to call when the forms changes...

jcf.refreshAll();

I've read up about behaviours, but it seems to be all about creating your own module. Is there a simple way to call the above when the form changes?


texts: Navigation not displaying in Omega 4 subtheme

texts:
I have made an Omega 4 subtheme cloned from the omega default starterkit using drush. I made a layout template based on /sites/all/themes/omega/omega/templates/system/page.tpl.php, and selected it.
The template documents the following for region content:

   $page['branding']: Items for the branding region.
   $page['header']: Items for the header region.
   $page['navigation']: Items for the navigation region.
   $page['help']: Dynamic help text, mostly for admin pages.
   $page['highlighted']: Items for the highlighted content region.
   $page['content']: The main content of the current page.
   $page['sidebar_first']: Items for the first sidebar.
   $page['sidebar_second']: Items for the second sidebar.
   $page['footer']: Items for the footer region.

However, $page['navigation'] does not have any content for any of my pages, so the navigation is not rendering here:
    <?php print render($page['navigation']); ?>

My pages all have "Provide a menu link" checked, and the navigation region is enabled in my layout.inc file.

I am new to Omega 4 - what am I missing?

One thing I have found is that $main_menu does have the menu items set as an array - am I supposed to populate $page['navigation'] myself from $main_menu in layout.preprocess.inc?

I'd be grateful for any help.


texts: Which Rules Event can I use for automatic login from main site to sub site with same database after clicking on a link?

texts:
In the home page of main site, I am listing all the products. Buyer has logged into the main site and clicks on any product title or image, then I take the buyer to the corresponding sub domain individual product page. In the redirected page or site I want the buyer to logged in since I am using the same database.

This is what I have done for that to happen:

I am using the Rules module to redirect from one site to another site.
The Rules Event I am using is Content is viewed, but actually it doesn't get called at all.
In Rules I am using page redirect action with value http://[node:author].[site:url-brief]/ajax_callback.php?context=buyer-redirect&username=[account:name]&nid=[node:nid]

In my ajax_callback.php file I have used this code:

case 'buyer-redirect':
        global $user;
        $username = $_REQUEST['username'];
        $user = user_load_by_name($username);
        $login_array = array ('name' => $username);
        user_login_finalize($login_array);
        $nid = $_REQUEST['nid'];
        drupal_goto('node/' . $nid);

But in the sub domain still I am not logged in as buyer.

Above mentioned is a PHP file where I am manipulating the requests, but Rules Event "Content is viewed" is not all getting invoked.

How can I make buyer login info to be send and make the buyer to be automatically logged in which clicking on a link in main site?

Any suggestions?


texts: Print just the value of Views field inside of views-view-fields template

texts:
I cannot for the life of me figure out how to print the value of a field in the 'fields' template.  Currently, I'm doing this to strip the unnecessary html (don't laugh):

<?php $shortContent = $fields['field_short_name']->content; ?>
<?php $shortText = strip_tags($shortContent); ?>
<?php $strategy = $fields['title']->content; ?>
<?php $cleanStrategy = strip_tags($strategy); ?>
<?php $company = $fields['field_money_manager_company']->content; ?>
<?php $cleanCompany = strip_tags($company); ?>

<?php echo ''; ?>

    <?php echo '
' . $cleanCompany. '
'; ?>
    <?php echo '
' . $cleanStrategy . '
'; ?>

How can I just get the value of the fields without having to print the entire 'content' and then strip the unnecessary elements?


texts: call mp3player field (CCK Field) in a page

texts:
I Use MP3 Player module to play audio files. I'm looking for a PHP code to call MP3 Player from a specific node. (e.g. node 4) how can I do that ?

this code doesn't work:

<?php
$node = node_load(4);
print $node->field_audio[0];
?>

this is the result of print_r($node) in node 4.

stdClass Object (
[nid] => 4
[type] => story
[language] => en
[uid] => 1
[status] => 1
[created] => 1343931282
[changed] => 1343931282
[comment] => 2
[promote] => 1
[moderate] => 0
[sticky] => 0
[tnid] => 0
[translate] => 0
[vid] => 4
[revision_uid] => 1
[title] => 5455
[body] =>
[teaser] =>
[log] =>
[revision_timestamp] => 1343931282
[format] => 1
[name] => admin
[picture] =>
[data] => a:0:{}

[field_audio] => Array (
[0] => Array (
[fid] => 7
[uid] => 1
[filename] => audio.mp3
[filepath] => sites/default/files/audio.mp3
[filemime] => audio/mpeg
[filesize] => 3663455 [status] => 1
[timestamp] => 1343931251
[list] => 1
[data] =>
)
)

[last_comment_timestamp] => 1343931282
[last_comment_name] =>
[comment_count] => 0
[taxonomy] => Array ( )
)


texts: Views: exposed filters for entity reference, do an AND?

texts:
I have a View that has exposed filters that searches and returns results for one content type.

I have a few entity reference fields (some content, some taxonomy) that when a user selects multiple values, I want them to be AND'd and limit the result set. It seems that Views is doing IN () no matter what config I set for the filter, which widens the result set as you select more instead of narrowing them down to results that match exactly/only what was selected.

For example, if I have an exposed filter for field_nodes and the user checks off 1, 2, 3 and submits, I only want nodes that have 1, 2, AND 3 in that reference field values. Not any node that matches any of the values.


texts:
I have a "first name" field, and I would like to programatically change its attributes. I want to modify this field, but not to create one new field again.

Is it possible?


texts: How to get rid of text box artifact with Fivestar module?

texts:
I'm using Drupal 7.14 and Fivestar 7.x-2.0-alpha2.  There is a text box artifact displayed below the stars on all nodes with a Fivestar field (see screenshot below).

Here is the HTML/CSS source for this screenshot:

great

Reader Rating:&nbsp;

3

I suspect that

 is what is creating this empty text box.

This empty box being shown is despite having chosen No text in the Text to display under the stars dropdown menu for the Fiverstar field at /admin/structure/types/manage/$content_type/display (where $content_stype is a dummy for whatever content type I am editing).

Am I missing something?

Is there another option somewhere to get rid of this annoying text-box?
Is this the default behavior of Fivestar/would I need to manually modify Fivestar to fix this?
Or is this a bug that noone has reported yet (I couldn't find anything that sounded like this issue here)?  I would think that if this was a bug someone would have reported it already (it is pretty noticable) so I'm inclined to think I am just missing something--but if people think that this is a bug, please indicate as much and I will remove the question and file an issue!

Thanks in advance for any help.


texts: Webform confirmation message is not being saved

texts: When I change webform confirmation message it doesn't save in db and shows the last state. The dpm($form_state) in webform submit function shows that confirmation text in $form_state['input'] and $form_state['values'] differs. Consequently its dropping inserted values. I try to clear cache in cache_form table but its not working. Any ideas?


texts: How to add JavaScript or CSS library to Composer project?

texts:
For some cases, there is the need to add a JavaScript or CSS package to a project. One of those cases was the DropzoneJS package for the drupal/entity_browser. All recommendations I could read online read like

  Download manually
  Install manually

or like

  Use Drush

This is not really satisfying as there should be a way without user interaction or working around interaction in setup scripts.


texts: Custom Styles Applying to page.html.twig but not html--front.html.twig

texts:
I'm new to drupal and am trying to make my own theme. Currently I have a page.html.twig for my pages, and my css styles show up fine. However, when I added a html--front.html.twig file, cleared the caches, and checked the homepage, there were no styles, even ones that apply to elements that are in every page (such as body). The code in html--front.html.twig is identical to the code in page.html.twig. I checked the console and the front page is successfully templating from html--front.html.twig. Every other page works fine. I just don't see why it is now ignoring all my styles for the front page. Here is the code for both pages:

    {{ page.header }}

    {# link is in html.html.twig #}

      {{ page.content }}


texts:
I am developing a complex website which will serve as an online magazine.

I am currently experimenting with the Book module and organizing my content in months but I am not sure it is a long term solution.

I am trying to achieve a setup which at midnight of February 28th will automatically publish all content associated will the new month of March and un-publish content for the previous month.

I would greatly appreciate any suggestions to achieve this.


texts: How do I use the form hook alt to edit fields of inline entity form?

texts:
I am trying to use the hook_form_alter to modify the fields of an Inline entity form in a commerce product display node.

I know how to edit a normal field but this does not work for an entity form field. How do I go about editing a field, for example changing the price field label?

Thanks
Robert


texts: How to add other types of dynamic attributes in the BODY tag?

texts:
i have this code to include node-ID attributes to the body tag on the page. My question is ... how can i modify this code to get additional dynamic attributes for the BODY class? The most important for me are classes for the current vocabulary and taxonomy term, possibly a panel page.. I has been searching for few days and found only solution for node-ID.

Thank you many times for help.

 /**
 * Implements hook_preprocess_html().
 */
function enar_preprocess_html(&$variables) {
  $node = \Drupal::request()->attributes->get('node');
  if ($node) {
    $variables['attributes']['class'][] = 'page-node-' . $node->id();
    if (empty($node->get('body')->value)) {
        $variables['attributes']['class'][] = 'no-padding-main-content';
    }
  }

   // Don't display the site name twice on the front page (and potentially others)
  if (isset($variables['head_title_array']['title']) && isset($variables['head_title_array']['name']) && ($variables['head_title_array']['title'] == $variables['head_title_array']['name'])) {
    $variables['head_title'] = $variables['head_title_array']['name'];
  }

  // Preloader configuration
  $preloader = theme_get_setting('preloader');
  $variables['attributes']['class'][] = $preloader;
  $variables['preloader'] = $preloader;
  // Go to top configuration
  $goto = theme_get_setting('gototop');
  $variables['goto'] = $goto;
}


texts: Add a js file and be sure it is executed as last js file?

texts:
I need to add a js file and make it to be executed as last js file (after all js that belong to modules)

I create a module for this. But I can't manage the order of modules execution. Don't I?
¿should I add this file in my theme or through a function instead?


texts: If I download a sub-theme do I install it under the main theme's directory?

texts:
For example, I found this theme, which says it requires the Nucleus Base theme.

Does that mean that I need to install it in the Nucleus Base theme directory?


texts: Adding a date time field value within a node programmatically

texts:
[field_download_time] => Array
            (
                [und] => Array
                    (
                        [0] => Array
                            (
                                [value] => 2012-11-27 09:38:00
                                [timezone] => America/Phoenix
                                [timezone_db] => America/Phoenix
                                [date_type] => datetime
                            )

                    )

            )

What I see for a field_download_time is given above..
I am adding nodes programmatically so the code for following field is as given below

 $download_node->field_download_time[]['value'] = date('m-d-Y H:i', REQUEST_TIME);//--?

I don't get an error on running the above code but the value of current date is not displayed

But When I run the following code given below I get an error
THE ERROR : Actually the code is such that when u go to the link it downloads a file .Basically the error is that  file is not downloaded.

  $download_node->field_download_time['und'][]['value'] = date('m-d-Y H:i', REQUEST_TIME);//--?


texts:
How to change an address field that says "There is data for this field in the database. The field settings can no longer be changed."?

I want to add a "Company" field as part of the address. I don't want to ditch all existing address data. I don't want to create a separate field.


texts: Create view containing all content containing taxonomy terms in free text?

texts:
I am using a taxonomy together with the Lexicon module to automatically create links to another website (a pretty neat solution with instructions here)

But I would also need to create view that list all nodes that contain the taxonomy terms. I am fairly competent at using the views module but I cannot figure out how to take the list of taxonomy terms and display all nodes that contain the terms in the text and what taxonomy terms the node contain.


texts: Create a view with checkboxes per role, that generates an email to an admin

texts:
I want a registered user to be able to tick rows in a table, and then submit an email to a predefined email address containing the titles of the selected rows.

VBO almost does what I want - in that there is a "send email" option, but on clicking the button it displays a form to be filled in with email address, title subject etc to send the email - I don't want that, I want it just to send a single email when the user clicks the button containing the titles of the selected rows.


texts: How to make rendered product variations show in a grid rather than a list?

texts:
I need to present some product variations rendered in a grid, without any cart options.
The idea is to have the user click a link to the product and present a page with the variations.

The easiest way I manage to do this is: in content->manage display I only show the field:Product Variations, with the format:Rendered Product, which gives me exactly what I want. Except it is displaying the rendered variations in a vertical list rather than the nice grid like it shows by default in the product list view.

Where does the presentation of this rendered product variation elements come from?

I'm using the default theme:commerce kickstart omega.


texts: Load Javascript Conditionally Based on Form Value

texts:
I have two different kinds of webforms, one I'll call "type 1" and one I'll call "type 2". Depending on the type of webform, I want to conditionally add either type1.js or type2.js. The type of webform is has a hidden field called formtype that an admin would set either to "type1" or "type2," and then, theoretically, I would pull in the proper Javascript based on that value when the form loads.

My hook_form_alter() function looks like this:

<?php
/**
 * Implements hook_form_alter().
 */
function module_name_form_alter(&$form, $form_state, $form_id) {
  if($form['submitted']['formtype']['#default_value'] == 'type1'){
    drupal_add_js($js_path . 'type1.js');
  }
  elseif($form['submitted']['formtype']['#default_value'] == 'type2'){
    drupal_add_js($js_path . 'type2.js');
  }
}
?>

This does actually cause the proper javascript to load, but I get a Drupal message saying:

Undefined index: submitted (etc.)

My question is: why would I be receiving this error message even though the logic appears to work? I'm also open to other ways of handling this use-case.

FYI, I'm using Drupal 7.


texts: How is $search_results in search-results.tpl.php generated

texts:
Where is $search_results generated?

I've got an Apache Solr search, and I want to reorganize the content in a certain way, and modifying the theming as well based on certain conditions, but all I have with $search_results is a string with a list.

What I want is to segregate search results based on a value in the object that Apache Solr creates.


texts: Context Node Add Form and Wrong Button Position

texts:
I created a context node add form and added it to the panel page.
The form is displayed in the page but, "Save" button is wrongly positioned.

Another form also has the button wrongly at the top instead of bottom.
I updated the button's weight from my custom code to move the button underneath of the form, but it doesn't work.
I used CCK fields in my form.
I'm looking for a fix.


texts:
i have a page-view that shows all avatars from the community.
This view has an exposed filter.

This community-view has two attachment-views:
- most comments
- best authors

Now i want to have the attachment-views shown in the sidebar as a block.

How can i handle the attachment like a block?

Thanx Michi


texts: Where do you set/change the SKU for a new/existing product? - Drupal 7 Commerce

texts: i can't seem to find where to change the sku for an existing product variation. is this even possible? Where do i set this?


texts: drush up fails to update, though it says it deos

texts:
Here's my output...

# drush up drupal-7.39
Failed to get available update data for one project.                                                                                [error]
Update information last refreshed: Wed, 09/16/2015 - 14:21

Update status information on all installed and enabled Drupal projects:
 Name         Installed version  Proposed version  Status
 Drupal core  7.38               7.39              Specified version available

Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Project drupal was updated successfully. Installed version is now 7.39.
Backups were saved into the directory /root/drush-backups/civi2crm/20150916182131/drupal.                                                                           [ok]
Backups were restored successfully.                                                                                [ok]

And then if I immediately try the same thing again, I see that it still doesn't think it install 7.39.   I can confirm that /user#overlay=admin/reports/updates tells me that I am still running 7.38

# drush up drupal-7.39 -y
Failed to get available update data for one project.                                                                                [error]
Update information last refreshed: Wed, 09/16/2015 - 14:21

Update status information on all installed and enabled Drupal projects:
 Name         Installed version  Proposed version  Status
 Drupal core  7.38               7.39              Specified version available

Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Project drupal was updated successfully. Installed version is now 7.39.
Backups were saved into the directory /root/drush-backups/civi2crm/20150916182138/drupal.                                                                           [ok]
Backups were restored successfully.

Any thoughts why I can't update Drupal.  And, in case it matters, I'm using Drupal to run CiviCRM.   And I think that is the "project" that it failed to get update data for.  But I believe I have to manually update CiviCRM by copying files and stuff, so that seems okay to me.   But perhaps I'm wrong on that.  But I can't see why, since I JUST want to patch the Drupal Core with the security update.


texts: render or print image in a drupal 7 node.tpl?

texts:
I am trying to theme a node with tpl and when i tried to print image , I cant find image path like in d6.. which function i have to call to properly output image .. I mean something like theme('')?

Array
(
    [und] => Array
        (
            [0] => Array
                (
                    [fid] => 13
                    [alt] =>
                    [title] =>
                    [width] => 416
                    [height] => 335
                    [uid] => 1
                    [filename] => Capture2.PNG
                    [uri] => public://Capture2.PNG
                    [filemime] => image/png
                    [filesize] => 215377
                    [status] => 1
                    [timestamp] => 1346837738
                    [rdf_mapping] => Array
                        (
                        )

                )

        )

)


texts: Remove/Hide the block if the View is empty?

texts:
Is there any API to know if the block is empty? Basically what I'm trying to do is to hide/unset the block inside template_preprocess_page.

Here is my currrent code:

 if ($variables['page']['rail_full']) {
    foreach ($variables['page']['rail_full'] as $keys => $blocks) {
      if (isset($blocks['content']['#views_contextual_links_info'])) {
        $name = (isset($blocks['content']['#views_contextual_links_info']['views_ui'])) ? $blocks['content']['#views_contextual_links_info']['views_ui']['view']->name : '';
        $display_id = explode('-', $blocks['#block']->delta);
        $block = views_get_view_result($name, $display_id[1]);
        if (empty($block)) {
          unset($variables['page']['rail_full'][$keys]);
        }
      }
    }
  }

But the above code always return a count of 1 when I print $block.

The below works fine but not a good solution. I want it to be dynamic in all block as possible.

if (!isset($variables['node']->field_author_favorite_links['en'])) {
    unset($variables['page']['rail_full']['views_franchise_page-block_2']);
}

if (!isset($variables['node']->field_article_column['en'])) {
    unset($variables['page']['rail_full']['views_franchise_page-block_3']);
}


texts: ajax form link how to call form function with parameters

texts:
Is there a good way to use ajax link in form, to call ajax callback function?

I have form elements and i would like to add link, that would call form creation function with some paramaters, so i can change the form accordingly.

The same as form select, which on change submit's form and sends values ...

thanks guys!


texts: Remove "read more" when there is no more text to read

texts:
I have just set up a new website with Drupal 8. I created a new content with a regular HTML that contains basic text. I promoted it to homepage, I see a "read more" link. But there is no "more" to read.

How can I remove "Read more" link if there is no more content to read?

I found some modules for Drupal 7 but I am following a certain solution for this general problem.

And also I am curious; isn't it obvious that there shouldn't be a "read more" link when there is no more content? Is it a bug or something?


texts: Page title not displayed at the top of the Content area

texts:
The page title is displayed in the breadcrumb, but not as a page title, at the top of the content area. Is there a setting somewhere I can edit, or will I need to manually add it to node.tpl.php?

The Title field is there, in the Content type - manage fields.

The search results page however, does have the page title displayed at the top of the content...(?)


texts:
I'm making the leap from Drupal 7 to Drupal 8 and am still fuzzy on some core concepts, particularly relating to dependency injection (DI). I've read plenty of tutorials and have a grasp on DI with services, but am unclear on using DI with something like \Drupal::Url().

For instance, I am using the following code in a class:

use Drupal\Core\Url;
...
$url = Url::fromRoute('<current>', [], ['absolute' => 'true'])->toString();

From what I can tell, there is no Url service. So, what I am wondering is: Is it possible to access Url via DI? And if so, how?

Bonus points: I intend for the class I am writing to be used as a service. Does this have any impact on the answer?

Edit: Fixed erroneous code.

Edit 2: I should also point out that the purpose of this call is to retrieve the current absolute URL so that I can determine if it is HTTPS.


texts: How to configure URL paths using the pathauto module for multilingual sites?

texts:
I am working on multilingual drupal website.To generate content path(i.e url) I am using pathauto module. I have not configured this module.

When I add content from basic page it sets content/[node:title] as url path seetings. It is fine for english language. But for other language content I want to set url same as english content.

What path pattern I have to set so that url path for nepali content is same as english content ?

Any help is welcome!


texts: Major differences between Drupal-6 and Pressflow-6?

texts: I am having a Drupal-6 site and was considering to scale it. I came across Pressflow and was wondering about the major differences between the two. I came across a similar question of Drupal-7 vs Pressflow-7 but was looking specifically for Drupal-6 vs Pressflow-6. Can anyone enlighten or share their experience of using both.


texts: Filter view by taxonomy terms of current user

texts:
I've done lots of work with Drupal 6, but currently have no more ideas how to approach this problem in D8. Please help me :)

I have added taxonomy term field to user profile and would like to filter a view allowing only content having terms listed in user profile.

For example: User has terms "manager" and "south" is presented with content having either of this term without having to select exposed filters etc.

The point is not to restrict content (like with taxonomy access control), just to provide more relevant content.


texts: How can anonymous users be allowed to post while still maintaining content integrity?

texts:
A little background: As you see on http://charlotte.ebayclassifieds.com, if you click 'post an ad' and then choose a category, you can fill out the form and submit content without having to sign up.  This is all done and managed by sending validation emails to the email address field which, when clicked, allow a user to manipulate their content.

Can similar functionality be achieved in Drupal. I don't mind writing a module, but before I do, I want to make sure I am not reinventing the wheel.

I have a Drupal based local classifieds site for my community at http://www.gastonia.com.  The site is growing in anonymous traffic, but few users are signing up to post. After a couple feedback loops with the community, almost everyone is saying that the one barrier to entry is having to sign up for an account, check email, validate, figure out how to navigate to post an ad, etc - indeed there are 7 steps necessary to go through before an ad actually gets published.  It's too much..

We have reworked the architecture to be able to get it down to two clicks - click to post, then click to save. More specifically, a user clicks on 'Add content' and the node/add form pops up (there is now only one content type in the new architecture); Then, when they are done, they click save.

Originally I thought about the Inline Registration module, but it is still in DEV and the logic really is not there to support if the user comes back to post again with the same email address (without loggin in). I could alter it, but then we are back to writing a module.

I also thought about Rules - could rules handle similar functionality as the ebayclassifieds site or what I am trying to do? It would all be based on an email filed in the node/add form (CRUD functionality).

What direction or recipe would you suggest to achieve the functionality? Of course the ultimate goal here is to allow anon users to post; create an account behind the scenes for future use; allow use of the anon form even for users with emails that already have accounts (and assign content accordingly.) all while maintaining the security (from spam, bots) that is afforded by having a user sign up and authenticate an account.

EDIT: 4/1/2013
Gisle Hannemyr has revived the Anonymous Publishing module which is very close to achieving the goals described here and in other posts. Please take part in the the thread to provide some community feedback as to how to make the module bug free and better:
http://drupal.org/node/1957644


texts:
I'm trying to translate a link in footer on my views .
the code is :

<?php
$link = l(t('Click to view all the writing categories'), 'somewhere', array('attributes' => array('class' => array('read-latest'))));
print $link;
?>

The problem is after tranlate it from admin/config/regional/translate .
the output is <div> no link and no <a> tag .
Any idea ?


texts:
I'm using Migrate to import entities.

I want to exclude rows based on a custom plugin (my source has a "url" field and I've to check if this url contains a "www.mysite.com" string: if not, the rows must be ignored).

How can I do this?


texts:
I have a content type: products. This content type use its own taxonomy (type1, Type2, Type3).

My content has 2 fields: Title and baseline (and more, but I don't want to use them on this view).

What I want:

Display a page with my products listed by taxonomy

Type1
   [title Product 1] [baseline product 1]
   [title Product 2] [baseline product 2]
   [title Product 3] [baseline product 3]
Type2
   [title Product 4] [baseline product 4]
   [title Product 5] [baseline product 5]
Type3
   [title Product 6] [baseline product 6]

I can do this easily, But I want more: I want to use views accordion module to display that. And I want the types being the header tabs.

The problem is: whatever I try, I get the same problem:

the module makes each node a tab

Type1
<title Product 1 tab >
   [title Product 1] [baseline product 1]
<title Product 2 tab >
<title Product 3 tab >
Type2
<title Product 4 tab >
<title Product 5 tab >
Type3
<title Product 6 tab >

In screenshot: (Don't pay attention of the text, it's some creepy test content):

My objective:


texts: DrupalQueue worker callback in separate file

texts:
This is my first time using the DrupalQueue class, and I have two questions.

Does hook_cron_queue_info() HAVE to go in my mymodule.module file? I had some weird behavior before finally trying that, and it seems to be the culprit.

Can I put the queue worker callback in a separate file? I'm trying to keep all my queue functions in their own file, but it doesn't seem like I can do a file attribute like with a lot of other callback types; I just keep getting function undefined errors.

I tried...

function mymodule_cron_queue_info() {
  $queues['autopilot'] = array(
    'time' => 60,
    'worker callback' => '_mymodule_queue_handler',
    'file' => array('type' => 'inc', 'module' => 'mymodule', 'name' => 'includes/mymodule.queue'),
  );
  return $queues;
}

and

function mymodule_cron_queue_info() {
 module_load_include('module', 'mymodule', 'includes/mymodule.queue.inc');
  $queues['autopilot'] = array(
    'time' => 60,
    'worker callback' => '_mymodule_queue_handler',
  );
  return $queues;
}

but neither seem to work.


texts:
I have the following snippet.

function <themename>_preprocess_node(&$vars) {
  if ($vars['teaser'] && !$vars['is_front']) {
    $vars['theme_hook_suggestions'][] = 'node__teaser';
  }
  elseif ($vars['teaser'] && $vars['is_front']) {
    $vars['theme_hook_suggestions'][] = 'node__teaser__front';
  }

  if (!$vars['teaser'] && count($vars['field_related']) > 2) {
    $vars['theme_hook_suggestions'][] = 'node__alt';
    foreach (element_children($vars['content']['field_related']) as $k) {
      $vars['content']['field_related'][$k]['#attributes']['class'][] = 'grid_1';
    }
  }
}

Basically, I have this field_related in my node that holds from 0 to 3 values. If it holds more than 2 values, I change the template suggestion (node__alt) and I'd like to attach a class (grid_1) to each of the values. I've spent the last 4 hours researching but nothing got me even near to where I want to go.

Do you have any idea?

EDIT In the template file I did like this:

<aside id="related">
  <?php foreach(element_children($content['field_related']) as $k) : ?>
    <div class="grid_1">
      <?php echo render($content['field_related'][$k]) ?>
    </div>
  <?php endforeach ?>
</aside>

It works, but it is far from being clean.


texts: adding css in fresh.css nothing change is made

texts:
I'm using sub theme zenophile and created sub theme and now in my own sub theme I added some css rules in fresh.css but it's changing nothing.

I did clean refresh, but nothing happening...


texts: How can I render a view on user-profile.tpl.php that includes the user name as an argument in Drupal 7?

texts: In Drupal 7, on a custom user profile page (using user-profile.tpl.php) I would like to place a view that references all nodes of a specific content type that has that user as a reference. (The user may, or may not be an author of the node.)


texts: Integrating a local php script into drupal block

texts:
I am trying to integrate a local PHP script (a guestbook script) into a block, but the links it outputs are not correct. They point to the index.php file used from Drupal, instead of point to its own index.php file.

Is there a way to make the links point to the right index file?


texts: Decoding cyrillic %get[] parameter in Ajax form

texts:
I have a request form in a popup window. It's located on a page of single product and must send product's name. This name's delivered using a hidden input field (Drupal Webform), which takes its value from %get[product]. The problem's that the site's in Russian so the result is url encoded and not readable.

The programmer who was asked to fix the form just replaced all Russian characters with corresponding English letters. But that's not a decision )

I can't just put php code in that field - Drupal doesn't understand it. Are there any other options?


texts: drupal webform url to edit existing response to question

texts:
I have a webform in Drupal, with 3 questions Q1, Q2 and Q3.

The users have permission to edit the responses to the webform, and view their own answers.

Hitting on EDIT link now takes the user to the beginning for the form.

I would like to create 3 links, that would take the user to the respective question, in EDIT mode.


texts: How can I filter entity titles in an autocomplete form and use the title as context for a View page?

texts:
I am trying to provide a form with a single autocomplete text field on the front page.  The user can search for a title of the product (commerce_product), and when they submit, they're redirected to a views page with the title as context.

These are baseball cards from multiple sellers, so there can be many cards and variations of a single card with the same name, e.g. multiple sellers sell a "Barry Bonds" card.

When the user enters the name of the card and submits, I need to redirect them to a views page to display all the cards for that particular title (card name).

The part I'm trying to figure out is how to use the selected title on the front page and send the user to a views page with that title so I can use it in a view. I assume that would be a Context, but I'm not having success finding how to do that.  To clarify the flow:

User hits front page and searches for a product title.
The user submits and is redirected to a views page.
On the views page, the user can browse all the cards under that title.


texts:
I have a view page on which I have rendered the comment form for each node in the field using the code below:

  $comment = new stdClass;
  $comment->nid = $n->nid;
  $form = drupal_get_form('comment_form', $comment);
  print render($form);

All my forms are printing fine, but the issue is that when I enter a message on message field and click submit, it redirect me to node page with comment form at browser top and my message is lost. If I type and click save here, my message saves without an issue.

I altered the form, added a custom_submit_handler as follows:

$form['#submit'][] = 'mymodule_custom_submit';

and defined it as:

function sparx_custom_submit($form, &$form_state) {
 if(isset($form_state['custom_redirect_path'])) {
   $form_state['redirect']  = $form_state['custom_redirect_path'];
 }
}

Now the problem I am facing is that each time I try the comment is getting added to the top-most node, not to any other node.

Any suggestions please


texts: How to show pop up message "Are you sure ......?" with "OK" button before save the content

texts:
I have a image field on profile content type. And when users try to save the content without uploading images I would like to show pop up confirmation message "Are you sure you want to save your profile without photos?"  with "OK" button. And I need the content to be saved only after the users click the "OK" button.

I thought I could do this with Rules module however it look like there is no action for showing popup message with "OK" button of confirmation.

Is there any way to achieve this?


texts: How to see an overview of the download statistics of all modules on drupal.org?

texts: At the moment the usage overview page on drupal.org gives an idea of the number of sites using a certain module. However as noted this includes information from only sites that include the update status module which means it is biased toward newer sites, is there a way to see an overview of the download statistics of a module as well in a similar view?


texts: How to get values from $form_state with webform

texts:
I'm using webform for submission and trying to simulate
GET parameters (though by default it uses POST).

Here's my code implementing hook_form_alter():

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  $nid = 2;
  if ($form_id == 'webform_client_form_' . $nid) {
    $option['query'] = array(
        'name' => $form_state['values']['name'],
        'email' => $form_state['values']['email'],
        'gender' => $form_state['values']['gender'],
        'birthday' => $form_state['values']['birthday'],
        );
    $form['#action'] = url('path/to/myViewsPage', $option);
  }

Above code should take me to

'path/to/myViewsPage?name=tom&email=tom@gmail.com&gender=male&birthday=12/21/2013'

But I got following error:

  Undefined index: values in mymodule_form_alter()

Could someone tell me where to define the $form_state['values']? Isn't it predefined by Webform?


texts: simplenews. confirmation of subscription for registered user

texts:
purpose: confirmation of subscription for registered user

installed on the website simplenews module (https://www.drupal.org/project/simplenews).
now on the main page there is a form to subscribe to the newsletter.

if the user is not authorized, he introduces email and sends a subscription request,
he comes to notice by email that he signed up for the newsletter and confirm the proposal (!) the desire to receive the newsletter.

if the user is authorized, he sees only the button (email enter) and if you send a subscription request, it immediately becomes signed.

can to make it so that an authorized user before activating the subscription, as well as anonymous, received a notice to activate your subscription?


texts: How to handle the cache per user in REST Resource?

texts:
I have a requirement to expose a specific content type data via REST end point. Below is my code:

public function get() {
    $current_user = $this->currentUser->id();
    $user = $this->entityTypeManager->getStorage('user')->load($current_user);
    $userLangId = $user->language()->getId();

    // You must to implement the logic of your REST Resource here.
    // Use current user after pass authentication to validate access.
    if (!$this->currentUser->hasPermission('access content')) {
      throw new AccessDeniedHttpException();
    }
    $news_values = [
      'langcode' => $userLangId,
      'type' => ['story'],
      'status' => 1,
    ];
    $news_data = $this->entityTypeManager->getStorage('node')->loadByProperties($news_values);
    $newsfeed = [];
    $newsfeed['stories'] = ['Story' => array_values($news_data)];
    if (empty($newsfeed)) {
      return new ResourceResponse('No Newsfeed exist for this user.', 400);
    }
    $response = new ResourceResponse($newsfeed, 200);
//    $response->addCacheableDependency($current_user);

    $response->addCacheableDependency(CacheableMetadata::createFromRenderArray([
      '#cache' => [
        'context' => ['user.roles'],
        'tags' => ['user:3', 'languages:' . $userLangId],
      ],
    ]));
    return $response;
  }

I am getting a proper response with this but I am facing issues in handling the cache.
This content is user specific. Based on user language content will popup when they access.

In Response Headers I am getting below things:

X-Drupal-Cache-Contexts: languages:language_interface theme url.site user.permissions
X-Drupal-Cache-Tags: config:filter.format.basic_html config:rest.resource.newsfeed_rest_resource config:rest.settings config:system.site http_response languages:fr node:7 node:9 user:3
X-Drupal-Dynamic-Cache: MISS/HIT

In Cache-tags i have not added node key but its automatically coming and its working once node updated. But if i try to login with different user via basic auth on postman client, content is not changing at all. Its showing cached content for previous user. How I can cache the content per user. Please help me in this regard.


texts: How to get the user entered input value to do calculation?

texts: I am developing bank loan application in drupal 7. In my first page there is a option to enter the loan amount then --> Search the available loan. In a second page(form) i need to display the available loan offers, interest, etc... based on the user entered value in page-1. Now i need to get the user entered value on page-2 and have to check with DB(Database) and then needs to display the results. Help me to get out the solution.


texts: Get group number in views-view-grouping.html.twig

texts:
Is it possible to get the group number inside the views-view-grouping.html.twig? So the first group gets the number 1, the second number 2 etc.
Something like:
<div class='group-nr-{{ group_number }}'>
    {{ title }}
    {{ content }}
</div>

I need this to make three columns out of my groups.


texts: Accordion Menu - Where is the original CSS file of the module?

texts:
I tried for two hours to RTLize\Flip the module via Firebug & Style.css but without major success. So I figured this is one of case when the flipping should be done at the module's CSS files themselves. So I went to sites/all/modules/accordion_menu but I couldn't find anything that has all the CSS. I found only accordion_menu.css that doesn't have more than 4-5 rows of CSS code. So it's not something I could RTLize\flip.

Therefore I ask, where is the genuine Accordion Menu CSS file (that appear in DOM but not in the style window)? How could I track it down and flip it's CSS?

Thanks,


texts: How can I resolve my fatal error during Drupal installation within XAMPP?

texts:
I'm installing Drupal in XAMPP in localhost (I am using Windows).

I went to localhost/drupal (which maps with the files on my C drive -> xampp -> htdocs -> drupal) and proceeded.

Right after I entered the details on the databse page and proceeded, it gave an error like so:

  "Fatal error: Call to undefined function user_access() in C:\xampp\htdocs\drupal\core\modules\system\system.module on line 2134".

When I return to localhost/drupal I keep getting the same error.

How can I resolve this fatal error?


texts: Getting the available template variables in a custom module

texts:
I'm making a custom module that will hook into the default theme and override a template file. Like you can do in a custom theme. At this moment I can already use the template that was made in the custom module with the hook_theme() function, it shows in my page. But the available variables are not showing in here. (for example: content, attributes, ...).

Probably because the module does not recognise these variables? How do I pass these variables to the template in my custom module. I read about the function hook_preprocess_HOOK() but no luck so far.

This is the implementation of hook_theme().

/**
 * Implements hook_theme()
 */
function episode_data_theme($existing, $type, $theme, $path) {
        return [
        'paragraph__episode_content_question_slider' => ['variables' => [] ],
    ];
}

This is the content of the template.

{#
/**
 * @file
 * Default theme implementation to display a paragraph.
 *
 * Available variables:
 * - paragraph: Full paragraph entity.
 *   Only method names starting with "get", "has", or "is" and a few common
 *   methods such as "id", "label", and "bundle" are available. For example:
 *   - paragraph.getCreatedTime() will return the paragraph creation timestamp.
 *   - paragraph.id(): The paragraph ID.
 *   - paragraph.bundle(): The type of the paragraph, for example, "image" or "text".
 *   - paragraph.getOwnerId(): The user ID of the paragraph author.
 *   See Drupal\paragraphs\Entity\Paragraph for a full list of public properties
 *   and methods for the paragraph object.
 * - content: All paragraph items. Use {{ content }} to print them all,
 *   or print a subset such as {{ content.field_example }}. Use
 *   {{ content|without('field_example') }} to temporarily suppress the printing
 *   of a given child element.
 * - attributes: HTML attributes for the containing element.
 *   The attributes.class element may contain one or more of the following
 *   classes:
 *   - paragraphs: The current template type (also known as a "theming hook").
 *   - paragraphs--type-[type]: The current paragraphs type. For example, if the paragraph is an
 *     "Image" it would result in "paragraphs--type--image". Note that the machine
 *     name will often be in a short form of the human readable label.
 *   - paragraphs--view-mode--[view_mode]: The View Mode of the paragraph; for example, a
 *     preview would result in: "paragraphs--view-mode--preview", and
 *     default: "paragraphs--view-mode--default".
 * - view_mode: View mode; for example, "preview" or "full".
 * - logged_in: Flag for authenticated user status. Will be true when the
 *   current user is a logged-in member.
 * - is_admin: Flag for admin user status. Will be true when the current user
 *   is an administrator.
 *
 * @see template_preprocess_paragraph()
 *
 * @ingroup themeable
 */
#}
{% block paragraph %}

        {% block content %}
            {% set sliderDescription = content.field_slider_description|render|striptags %}
            {{ content.field_available_for }}

                {{ content.field_slider_question }}

{{ sliderDescription|length > 200 ? sliderDescription|slice(0, 200) ~ '...' : sliderDescription }}

                {{ 'Got it'|trans }}

                    {{ content.field_slider_question }}
                    {{ content.field_slider_description }}

        {% endblock %}

{% endblock paragraph %}

This is the debug output I get on the page.


texts: How to make a link in calendar module to current date?

texts:
Here is another calendar related question: I want to create a link-item that links to a view that filters events to the current date. Easy, you say?

Right now i have a mini-calendar block that show the current month and a view (type page) for events that has a contextual filter: Date: Date (node). It provides the default value Current Date if the filter value is not in the URL.

This works fine. The view shows the events for the current date when the /events page with the view is visited for the first time (no filter value in URL).

So, if the mini-block with the month view is used, it shows the events of that day accordingly. But if someone cycles through the months and wants to go back to show events of today he has to click back to the current month and date to show them.

Now i want a link-item that links to the current date view as a kind of shortcut, visible on all event-views, but i have no idea how to do that.

Right now i have my view duplicated, with an own path (/eventstoday) and a block with the link to that view, shown on event-view pages.

But there must be a way to achieve this with only one view...

Any help would be appreciated... and thanks for reading!

EDIT:

Additional Information about settings used: I use Ajax in the views and also the calendar configuration option: "Track current date in session" for all users.

  Store session information about the user's current date as they move
  back and forth through the calendar. Without this setting users will
  revert to the current day each time they choose a new calendar period
  (year, month, week, or day). With this option set they will move to a
  day that conforms to the time period they were viewing before they
  switched. Requires session tracking which is not ordinarily enabled
  for anonymous users.

I use Drupal 7.14 and the latest development-snapshots of calendar, date, ctools and views.


texts:
How can I change the output of dates in a long text field based on the locale?

I was looking for a module that might work with WYSIWYG to denote a date within a text field.

My goal was to allow articles to be viewed in several locales that use different date formats, without having to create separate versions of the articles.  All of the article content is the same except for references to dates.


texts:
I need to do the following on my Drupal 7 site:

Anonymous users should see the website in Ukrainian (I mean not the content, but the elements like "Login", "Register" etc.)
Administrator (the user with all permissions) should see the admin panel in English.
Editor (custom created user that can create pages) should see his admin interface in Russian.

I suppose it can be done with a per-user language setting, but I cannot find how to do this. I already have all the translations installed.


texts: From where drupal get the template? if i don't have one

texts:
I've created a template with the following.

myTheme.info

name = myTheme
description = Just my theme
core = 7.x
stylesheets[all][] = css/myCss.css

regions[test] = Test
regions[content] = Content

template.php

// Empty file

css/myCss.css

// Some styles

Drupal has position content and other blocks, but from where did he gets the template if mine is empty?

Also I get these errors:

  Notice: Undefined index: highlighted in include() (line 126 of Z:\home\test1.ru\www\modules\system\page.tpl.php).
  Notice: Undefined index: sidebar_first in include() (line 138 of Z:\home\test1.ru\www\modules\system\page.tpl.php).
  Notice: Undefined index: sidebar_second in include() (line 144 of Z:\home\test1.ru\www\modules\system\page.tpl.php).

It looks like it was used in the core template, but in my newly created template, I get this errors. Maybe I need to override some hooks? Which hooks should I override?


texts:
My registration form is multi-step and the form is shown in popup. I m using lighbox2 for popup and working perfectly fine and i have added the form filed in a file that comes with lightbox2 and place in template folder and everything work fine, but the issue is how i can add the form data in database?

I use ajax when the ajax request sent it says access forbidden.

how I can insert data in database using ajax because my form is multi-step?


texts:
I'm new to Drupal. I accidentally deleted the Tag feature on our article page. Could someone explain how I can add it back to that page.

It also populated on a specific page.


texts:
I have some questions about Drupal menus. I am interested to have a Contextual Menu in sense that its links change depending where the user is.

I have a Taxonomy Menu and I would like to show in the menu only the term links to the level where the user was. For instance,

Product

cat1
cat2

cat2.1
cat2.2

cat3

If I have the taxonomy shown above, if I click on product the menu should list only cat1, cat2 and cat3 but if I click cat2 menu should list only cat2.1 and cat2.2

How can do this on Drupal?

Thanks in advance!


texts: Adding product image to ubercart checkout form

texts:
Has anyone able to get through altering/overriding the core cart checkout form? Any hooks that can help?

I am trying to add a product image to Ubercart /cart page ie. CartForm.


texts:
Usually on node page we can see byline (Submitted by admin on date), but how to add that kind of info to the Panels pane?

It seems there is no single theme_node_submitted() anymore in Drupal 7 therefore it's quite inconvenient to achieve that now.

Any ideas?

Related: Submitted by byline in panes


texts: how to print google map field value in a page tpl

texts:
I am trying to print a value of submitted for a google map field in a page.tpl.php file. I used below code to print but got a error message. I am able to print other field types using similar code but unable to do the same for map filed. Please help

<?php
  $node=node_load(41);
  print "
".$node->field_add_map['und'][0]['GoogleMapField']."
";// print styled image
?>


texts:
Recently updated Drupal to 8.7.1 and I am seeing the following error when running database update:

www-data@php.container:/var/www/html/web $ drush updb -y
The following updates are pending:

media_library module :
  8701 -   Create the 'media_library' image style.
  8702 -   Updates the media library view widget display (contextual) filters.

comment module :
  Add comment settings.

media_library module :
  Create and configure Media Library form and view displays for media types.
  Add a table display to the media library view and link gridtable displays.

media module :
  Keep media items viewable at media{id}.

menu_link_content module :
  Update custom menu links to be revisionable.

system module :
  Initialize 'expand_all_items' values to system_menu_block.
  Clear the menu cache.   @see https:www.drupal.orgprojectdrupalissues3044364

taxonomy module :
  Update taxonomy terms to be revisionable.
  Remove the 'hierarchy' property from vocabularies.

views module :
  Update exposed filter blocks label display to be disabled.
  Rebuild cache to allow placeholder texts to be translatable.

Do you wish to run all pending updates? (y/n): y
'image_style' entity with ID 'media_library' already exists.                                          [error]
Performing media_library_update_8701                                                                     [ok]
Failed: 'image_style' entity with ID 'media_library' already exists.                                  [error]
Cache rebuild complete.                                                                                [ok]
Finished performing updates.                                                                             [ok]


texts:
My content type uses a field collection (field_site_web) to allow users to enter multiple websites, consisting of a name (field_site_name) and an internet connection (field_link).

I want to use a foreach() loop to get those value, but I do not know how to access these fields. How can I do?

EDIT

how can I do to avoid the error in the line of the foreach? I tried so, but does not work:

if($fc_fields != false){
  // Extract the field collection item ids
  $ids = array();
  foreach ($fc_fields as $fc_field) {
    $ids[] = $fc_field['value'];
  }
}


texts: Drupal Import Commerce Product Display Multiple Images With Feed?

texts:
So... I have been attempting to import a list of products from a D6 site into Commerce Kickstart 2.6 and at every turn it's fraught.

My latest attempt has been to
a) Use Node Export to get a CSV of products from old site. Good.

b) Import using Commerce Product Feeds, first to get the Product and then again to get the Display (nodes). Three problems:

How does one map the 'images' field in the CSV? The CSV I'm importing has a path to the JPG file for each product in the folder where the images can be found. Eg.

  /sites/default/products/myproduct.jpg

Two issues:

This works for -one- image, but not if the product has multiple images. I tried mapping the CSV columns for each image path to the 'Images' field in the importer multiple times but this did not work. Again, only the 1st image imported
I can't figure out how to add the ALT tag to each product.

So: should each image be simple strings or is there some other data format (eg. array)?


texts: i18n translate vocabulary field description

texts:
I want to localise vocabulary fields especially description field. Does it exist some function like i18n_taxonomy_localize_terms( taxonomy_term_load($tid) for taxonomy_vocabulary_load($vid). Or maybe some different method.

Thanks


texts: Easy way to copy drush vget variables from one site to another site?

texts: I have a bunch of vget variables to copy over to another dev site. What is an easy way to do this? I'm able save it to a file via "drush vget | ack var_name > myfile", but how would i do a drush vset using those variables saved in the file?


texts: How to add content title as dropdown list for exposed filter?

texts:
I have a node ABC and using view where content is of type ABC. I have content title as a field in Views.

What is the way in which I can get a drop down for field content title in the filter criteria?


texts: Make the git repo part of the drupal site so I can commit my changes whilst testing

texts:
I've got a git repo on my desktop with a couple of make files. I am currently building the drupal site in my htdocs folder by copying the distro.make file there, running the command:
 drush make distro.make geoslate_test --working-copy --no-gitinfofile

and then cding into the geoslate_test folder and running:

drush si vimn_geoslate --db-url='mysql://root:root@localhost/geo_test' --site-name=Geoslate

to install drupal.

I would like instead to have the git repo as part of the drupal site, so that I can commit my changes whilst testing on the site build install.

Any idea how I can do this?


texts:
I want to create a taxonomy view, which only displays terms that belong to a certain parent.

However, the "Term ID with depth" filter that appears in a normal view seems to be missing in the Term View type.

Any ideas how I might go about achieveing this?


texts: How to Map files if I have fid in Drupal 6 table and field in Drupal 7 content type?

texts:
I have a drupal 6 database in which custom table is used to store the details. In the custom table a column fid contains the fid of file.

I have migrated the files and it migrated successfully. I mapped the node fields to that fid. I have added the following code :

$this->addFieldMapping('field_image', 'fid')->sourceMigration('ExFiles');

It showing me following message :

The specified file 3424 could not be copied to public://3424.

I want to know how to map files from custom table field?


texts: Fire $.colorbox.resize() after overlay content is AJAX loaded?

texts:
Im using the colorbox and colorbox_node module. Out of the box you have to specify a fixed height for the overlay. However I want the overlay to be the same height as its content.

This can be done with $.colorbox.resize. The issue is that it doesnt work if I call it on cbox_complete. The reason is that cbox_complete happens before the content is loaded with AJAX, so its as if there is no content and the height is set to 0 (plus padding).

Ive got it working with the following. Its not a great solution, Its not completely robust and the time delay before the resize isnt an ideal user experience.

        $(document).bind('cbox_complete', function(){
            setTimeout($.colorbox.resize,1000);
        });

UPDATE - I dont know if its best practice (I expect not) but the following placed in the tpl file works:

UPDATE 2 - I spoke too soon. This screws up in IE8 (im not testing on 7 or 6). For one node the 'x' to close the overlay is missing. For the other node only the top 20px or so of the overlay is visible.

<script type="text/javascript">
    (function($) {
        Drupal.behaviors.global_custom_two = {
                attach : function(context, settings) {
                        $.colorbox.resize();
                }
    }})(jQuery);
</script>


texts: how to populate select list using hook_form_alter()?

texts:
I wanted to add values to a select list dynamically. Another module generates an array from a web service and I want to use those values to populate a select list in a form using hook_form_alter.

I tried directly adding the options in #options of the field using the following code

<?php $form['field_mage_category']['und']['#options']=$arr; ?>

The above code adds the options to the select list and returns a value according to the options selected but when the form is loaded again for editing. The option is set to default value and other issue is that when a single option is deleted. The respective value is not getting deleted from the field_data table.

I tried using #after-build property to populate the select list.below code is the call to _add_category_select_list function

      <?php function main_menu_form_alter(&$form, &$form_state, $form_id){
       if($form_id=='main_menu_node_form'){
           form['field_mage_category']['#after_build'] = array('_add_category_select_list');
          } ?>

and following is the code in the _add_category_select_list function

<?php function _add_category_select_list($element, &$form_state) {
$mlib=new Mlibrary();
$main_category=$mlib->get_main_menu_Categories();
   foreach($main_category as $main){
       $element['und']['#options'] = array($main['category_id'] => $main['Title'])+  $element['und']['#options'];
    }

return ($element);
   } ?>

The above code populates the select list but when the option is selected it is not returning any values for the options selected. Can anyone give me a proper way to add #options to select list dynamically using hook_form_alter or any other options that will allow me to add  options from my module.


texts: Adding steps, breadcrumbs, or navigation to multistep webform

texts:
I have a multi-step webform (about 10 pages), and I want the user to simply be able to skip ahead of their current location if they have had more progress previously.

I've been trying to use the Webform Steps module, but it's totally inaccurate and it shows the same button name for every form i.e. Step 1, Step 1, Step 1, not Step 1, 2, 3 etc. There's no customisation options for it, and I'm not comfortable with hacking it.

I've tried a couple other Modules, and they have similar behaviour, or they cannot actually link to other pages, as in the anchor tag is empty.

Is there a Module capable of doing this? Or do I need to do it myself? I'm relatively new to Drupal, and my PHP isn't that strong.

Any help is extremely appreciated!


texts: Disable image autoscale when dimensions are bigger than my settings

texts:
As you may know, in Drupal 7 you can set max and min dimensions for an image field, when you upload a small image, Drupal returns an error, but when you upload a bigger file it resize the image automatically instead of return the error "Your image is too big...".

I was looking for the reason of that autoscale configuration but looks like it will never be fixed. I need to override it because some of my users still uploading pictures with other dimentions, even with a different aspect ratio.

I found the condition in includes/file.inc line 1809 ... it tries to scale the image if it's bigger. I know that i can comment that condition and it will work, but is not a good idea, so:
Does anyone know how to override that condition using a custom module, hooks or something?


texts: How to display comment sequence number inside node?

texts:
I want to display comment sequence number as permalink.
The question is: how to count comments in particular node and then display sequential number of every comment?
I'm talking about Drupal 7.


texts: What does test status postponed for a patch on d.o mean?

texts:
I've added a patch for the rules module. The patch detail page says the test status is postponed.

What does that exactly mean? Is there anything I should do to get the patch tested?


texts: How can I findout where a custom variable is being created?

texts:
In a current Drupal 7 install i realize that all our CSS files are being declared in html.tpl.php using a variable $styles instead of through the templates .info file. I tried using Xdebug but all i managed to get is the info the variable holds. The same is also being done to javascript files which should really be at the footer instead of the header.

I have checked my themes template.php but i have not found a declaration of it anywhere.


texts:
I'm using Drupal 7.

Is it possible to add a CC to a webform email?

I was using

function theme_webform_mail_headers($variables) {
  $headers = array(
    'X-Mailer' => 'Drupal Webform (PHP/' . phpversion() . ')',
  );
  return $headers;
}

changing it with

    function MYTHEME_webform_mail_headers($variables) {
      $headers = array(
'CC' => 'ccmeail@domain.com', 'X-Mailer' => 'Drupal Webform (PHP/'. phpversion() .')',
 );
      return $headers;
    }

It does not work, I've cleared all the chaches and it does not add the CC.
How could I add the CC?

Thanks in advance.


texts: How to do translation via csv file imported from PHP my admin

texts:
I'm experimenting with a variety of modules to translate, but I find that a simple CSV file would be best.

TMGMT doesn't work for me as I get a lot of bugs that I can't resolve.

Is there a way to translate from CSV export from PHP my admin, translate and then re-import?


texts:
In Drupal 8, I installed all translation modules (Configuration Translation, Content Translation, Interface Translation, Language) and cleared all caches and run cron again.

But the titles defined in routing YML files are still missing from the User interface translation configuration page (/admin/config/regional/translate)

Any idea?


texts: It is possible upload a avatar during the registration process? Then save it into the profile.


texts: How can I let users enter the cck value once and then protect the field from editing?

texts:
I have several cck fields that shouldn't be modified once after the node is created. For example like fields for gender, name, birth date and so on.
Is it possible to hide or make them unable to edit those fields by users after the node creation?   I thought maybe I could do that by Rules but unfortunately it seems that there is no action for hiding cck field forms though it has the condition for "if field has a value".


texts:
When displaying a view of all the terms on my site in asc order, they read from A-z down.  Apply a grid-2 to each row, and they read as so:

A B C D E F G
H I J K L M N
O P Q R S T U

This is difficult reading in my opinion.  I would like them to read as so:

A D G J M
B E H K N
C F I L O

Is it possible to achieve a vertical list like this?


texts: Print url to image from profile2 field with mutiple images

texts:
Hello guys i've been trying to figure this out the past 20 hours but i can't.
I want to print som image url's to a link.
I have this code

<?php
  $user_fields = user_load(24);
  $profile2 = profile2_load_by_user($user_fields->uid);
  $image = field_get_items('profile2', $profile2['side'], 'field_baggrundsbillede');
?>
<?php foreach($image as $key=>$value): ?>
 $output = field_view_value('profile2', $profile2['side'], 'field_baggrundsbillede', $image[$key], array(
  'type' => 'image',
  'settings' => array(
    'image_style' => 'thumbnail'
    'image_link' => 'content',
  ),
));

   <?php print render($output) ?>

<?php endforeach; ?>

But the problem is that it prints the image file, when i want an url.
How can i make that happen?

Thanks

EDIT

  <?php
    $uid = 24;
    $user_fields = user_load($uid);
    //$profile2 = profile2_load_by_user($user_fields->uid);
    $images = field_get_items('user', $user_fields, 'field_baggrundsbillede');
  ?>
  <?php foreach($images as $key => $image): ?>
    <?php $url = file_create_url($image['uri']); ?>
    <div class="background-image" style="background-image: url(<?php echo $url ?>);">

  <?php endforeach; ?>


texts: Moving functions in block module to inc file

texts:
I have searched everywhere for an answer to this question, and have found little to no help on the subject.

The closest question to my own would be this, but the answer for it is a bit different than what I'm looking for:
How to move block functions into .inc file?

Here is my code for the most part (everything removed that wasn't necessary):

<?php

function custom_giggity_block_info(){
  $block['custom_giggity'] = array(
    'info' => t('Custom giggity'),
    'cache' => DRUPAL_NO_CACHE,
  );
  return $block;
}

function custom_giggity_block_view($delta = ''){
  $block = array();
  if($delta == 'custom_giggity'){
    $block['content'] = custom_giggity_contents($delta);
  }
  return $block;
}

function custom_giggity_contents($delta){
  //Code that generates what goes into $block['content']
  return $output;
}

And I need to use something like this, and don't know how to incorporate it:

function giggity_contents() {
  $items['giggity'] = array(
    'title' => "Giggity",
    'page callback' => "show_giggity", //or custom_giggity_contents ;)
    'access arguments' => array('access content'),
    'file' => 'giggity.inc',
    'type' => MENU_CALLBACK
  );
  return $items;
}

Now I realize that the second block of code there might completely off, but I'm just using it as an example as to what I need to accomplish.

Edit: So this is what I'd like to accomplish, but I'm not sure how the $items callbacks work. I took this piece of code from a hook_menu() and replaced it with giggity_contents.

<?php

function custom_giggity_block_info(){
  $block['custom_giggity'] = array(
    'info' => t('Custom giggity'),
    'cache' => DRUPAL_NO_CACHE,
  );
  return $block;
}

function custom_giggity_block_view($delta = ''){
  $block = array();
  if($delta == 'custom_giggity'){
    $block['content'] = giggity_contents($delta);
  }
  return $block;
}

function giggity_contents() {
  $items['giggity'] = array(
    'title' => "Giggity",
    'page callback' => "custom_giggity_contents",
    'access arguments' => array('access content'),
    'file' => 'giggity.inc',
    'type' => MENU_CALLBACK
  );
 return $items;
}

giggity.inc file:

 function custom_giggity_contents($delta){
  //Code that generates what goes into $block['content']
  return $output;
 }


texts: Old site migration and keeping links (as aliases)

texts:
I'm migrating an older site into Drupal 7 and have had a lot of success so far. One item where I'm stumped is on links to user profiles. The older system would link to teachers via

site.edu/faculty.php?PID=FirstnameLastname

Might there be a way to effectively copy that URL as the page's alias faculty.php?PID=FirstnameLastname? And yes, is there a way to escape the http encodings (?, =, and &)?


texts: How to suppress composer autoload when installed as an unused dependecy?

texts:
I'm running a D7 site with the composer module installed as an unused dependency of the OpenLayers Module. The issue I'm having is that my watch dog log is filled with RuntimeException: Autoloader not found: /var/www/html/phisigmarho.org/sites/all/vendor/autoload.php in composer_manager_register_autoloader() (line 173 of /var/www/html/phisigmarho.org/sites/all/modules/composer_manager/composer_manager.module). and has caused at least one  /home/phislub9/public_html/error_log [24-Feb-2017 09:57:30 America/New_York] PHP Fatal error: Class ‘SensioLabs\Security\SecurityChecker’ not found in /home/phislub9/public_html/sites/all/modules/composer_manager/composer_manager_sa/composer_manager_sa.module on line 83

Part of my issue is that the site is on a shared server that I don't think I can install composer on, so I'm kind of stuck letting the errors build up. I didn't think it was a problem till hitting the fatal error, and it's bad practice to let the script run and take up server resources. So is there some way to work around this? I don't use composer for anything, so I would happily get rid of it but it's a dependency. Can a dependent unused module be suppressed in some way?


texts: Can I use Drupal 7's CSS/JS cache buster/token programmatically?

texts:
By default Drupal adds a cachebuster to CSS and JS resources:

<style type="text/css" media="all">
@import url("http://example.com/modules/system/system.base.css?o0xoqx");
@import url("http://example.com/modules/system/system.menus.css?o0xoqx");
@import url("http://example.com/modules/system/system.messages.css?o0xoqx");
@import url("http://example.com/modules/system/system.theme.css?o0xoqx");
</style>

Is there a way to use the cache token (o0xoqx) programmatically in the template?

I'd like an easy way to add the same token to some other resources later on (namely: the whole lot of modern favicons), so I could "refresh" them more easily.