texts: Create custom endpoints by extending the Resource Base class

texts:
I created a custom endpoints by extending the core of Drupal. but I can not retrieve JSON data. I do not know what value to put in 'note: serialization_class

/** * Provides a resource to get bundles by entity.
*
* @RestResource(
*   id = "dna_custom_endpoint",
*   label = @Translation("DNA custom endpoint"),
*   serialization_class = ??????,
*   uri_paths = {
*     "canonical" = "/dnarest/{type}"
*   }
* )
*/

You know comprehensive guides that explain?

public function patch($type = 'type') {
    ???????
}

if you use what you said ( serialization_class = "Drupal\Core\Entity\Entity",) to me this generates fatal error PHP :

Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException: The Drupal\Core\Entity\Entity class does not correspond to an entity type. in Drupal\Core\Entity\EntityTypeRepository->getEntityTypeFromClass() (line 103 of /Applications/MAMP/htdocs/dnaphone/core/lib/Drupal/Core/Entity/EntityTypeRepository.php).


texts: In what format are CCK dates stored? If it stores dates in the database using a timestamp string instead of a native MySQL datetime format, what implications does that have in regards to storing dates before the unix epoch? Would it mean that CCK date fields would not be able to store something happening in year 1939, for example?


texts: Alter Block render array and add another block's content

texts:
I am attempting to attach a block to another block via hook_block_view_alter. The source block is a menu_block and the block to be attached is a view block, but the type of block shouldn't matter to the solution.

Here is the code used to attach the block. Assume that block_attached_block is populated with the bid of the block and at the point where I am altering the render array I have a fully rendered block.

function MODULE_block_view_alter(&$data, $block) {
  if (!empty($block->block_attached_block)) {

    // load the attached block from the database
    $attached_block = db_select('block', 'b')
      ->fields('b')
      ->condition('b.bid', $block->block_attached_block)
      ->execute()
      ->fetchObject();

    // render the block
    $block_content  = _block_render_blocks(array($attached_block));
    $build          = _block_get_renderable_array($block_content);
    $block_rendered = drupal_render($build);

    // attach the block
    $data['block_attached_block'] = array(
      '#type' => 'container',
      '#attributes' => array(
        'class' => array('block_attached_block'),
      ),
      'block' => array(
        '#markup' => $block_rendered,
      ),
    );
  }
}

If I render $data at this point I see the attached block rendered perfectly.

drupal_render($data);

However, when I load the page the attached block is missing. The documentation is pretty light.

My question is how do I get the rendered block to output on the page.


texts: No images, content, or theme after site migration from dev server to nginx on ubuntu

texts:
I have recently worked on a site for a client and worked on an acquia devdesktop to make changes on a Windows machine.  The production site is on a linux server and I am trying to deploy the site on a digital ocean ubuntu server running nginx. For some reason my file and folder permission are completely messed up. I have gotten the site to the point where some images show up, but my themes and content are still behaving strangely. I followed what I thought was the procedure:

Set up a clean installation.
Migrate the database
copy the sites folder
run the update script

I ran though a series of issues with folder permissions, and was able to squash most of the bugs. I don't get any meaningful to me warnings in the admin/status/reports, and near as I can tell I've tried to follow the correct permissions for files and folders.

site --> 775
site/default -->775
site/default/files --> 775

UPDATE: So, I guess part of the issue had to do with an .htaccess file htaccess file issues, but I still had a mess of warnings regarding the folder and ownership permissions. I guess the environments are really unfriendly to one another. This a big site with 85+ modules enabled. The annoying part is that I could only piece together the diagnoses from the php warnings. I finally hit a wall a WSOD.


texts: How do I give a role permission to set a site variable?

texts:
I have a custom variable in one of my modules and I want to be able to give permission to that variable to a specific role on my site.

I have the hook_permission function setup and I can see it in the admin/people/permissions interface, but I'm not sure how to implement a hook or whatever to give the user access to admin/config/system/variable/edit/my_custom_variable


texts: How to log in users without credentials?

texts:
We need to integrate a CRM into our Drupal site. Storing users in native database is forbidden, so we won't store users in our Drupal database, we will use CRM for that.

But we still need to be able to login/register users from drupal standard login/register forms. On a backend we need to login/register user programmatically so user would think he's logging in/registering on a site, instead he logs in/registers in CRM (which is a third party application).


texts: How can I make a gallery of "boxes" of content consisting of an image and some text?

texts:
My aim is to create a gallery of content boxes. Each box is comprised of a connected image and text, so that when you hover on a box, you could see some css effect like the one you can see in this site here and in the image from it.

Actually it's more than a gallery, the image and text are combined. I'm looking for a way to conjugate them. A gallery of conjugated image and text.

So i want to make the text and the image of the box one unit, so that they could easily get the same CSS, as in the example above. Since I've yet to learn JS, I think I need a module for that.


texts: How to get the field settings values in filed constraint validator

texts:
I have created custom type field with custom field settings, attached custom constraint successfully called its validator.

The question how to get the field settings values in the validate function, below code sample may explain

/**
 * Validates the CustomCheckConstraint.
*/
class CustomCheckConstraintValidator extends ConstraintValidator {
 protected $context;
 public function validate($data, Constraint $constraint) {
   //$data parameter holds the field value
   //how could I get the field settings here and validate the value based on
}
}

//attached constraint here
public static function    propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties['value'] = DataDefinition::create('integer')
  ->setLabel(t('type'))
  ->addConstraint('CustomCheck')
  ->setRequired(TRUE);
return $properties;

}

  Edit: After berdir answer

now the $data variable is an object holds the whole filedType object value and settings.

The problem is I couldn't get the field settings from getSettings() function returns

  Error: Call to protected method

The same error occurs when I tried to send field settings value from propertyDefinitions function


texts: What is the equivalent of hook_user with $op='form' in Drupal 7

texts:
What is the equivalent of hook_user with $op = 'form' in Drupal 7? According to the documentation of hook_user, 'form' means:

  form: The user account edit form is about to be displayed. The module should present the form elements it wishes to inject into the form.

But I couldn't find any equivalent hook in Drupal 7 user.api.php.
Thanks


texts: Why does the "admin/modules" page show up in the wrong language?

texts:
The error appears on a single language page with just one other language than English enabled (here: German) and set to default. All other admin pages show the the right language. Admin theme is "seven". I know, this is probably to broad or localized, but I can't wrap my head around this one...

Update: I have installed "Administration Toolbar" and this fixes at least language error in the toolbar. If i deliberately enable the "better toolbar" - option (that means 2 toolbars, one is drupal core and the other from "Administration Toolbar" at the same time), one shows up in German as it should and the drupal core one still in English.

But all the other text strings are still in English. Although they are present and properly translated on the "translate interface"-page (admin/config/regional/translate/translate).

I have installed the latest .po (7.43) file for German, cleared cache several times but to no avail.

Any hint where to look?

UPDATE II: Bug is related to Features module (https://www.drupal.org/node/2636140) That one was hard to track down.

UPDATE III: The bug was fixed in the latest Feature module update (7.x-2.8)


texts: How do I correctly add jQuery UI widgets?

texts:
Im using Drupal 7, which ships with jQuery UI. I need to have  Accordion only on the homepage. jQuery will not just let me download Accordion and then use drupal_add_js().

Do you have any suggestion?


texts: Does having too many cck fields negatively affect site speed and performance?

texts:
I building a site that could potentially utilize 50 different content types. The most of the content types have more than 40 CCK fields, including multiple field_collections entity_reference.

How can i take care about performance of site Specially for CCK fields level ?


texts: CSS not being loaded from CDN (CloudFiles)

texts:
I've got CDN installed and configured and I've copied all of my css up to the CDN.

The CSS urls change from this (using my hosts IP address):

@import url("http://xxx.xxx.xxx.xxx/modules/system/system.base.css?mhdfaw");

When I enable the CDN module, they look like this:

@import url("http://b24fb3007bd5cf6f616a-a6cd251ed0dfba89acb0fcd5fb378f4a.r38.cf1.rackcdn.com/modules/system/system.base.css?mhdfaw");

When I copy that url and paste it into my browser, the file exists and is being served by the CDN just fine. I have tested EVERY css file in the source and every single one of them exists, but my page is completely unstyled. None of the CSS files are being applied at all.

I'm not referring to the images in the stylesheets, I'm referring to ALL of the styles.

What the heck?

EDIT: Here is a link to my site, in case that helps:

http://108.166.112.120/blog


texts: Why are routing files filled with underscores?

texts:
What is the deal with all the parameters with, and without, a prefixed underscore character?

Where does Drupal decide how to process these parameters?

Was this concept introduced from Symfony, or is it new to Drupal?

Example (node.routing.yml):

node.overview_types:
  path: '/admin/structure/types'
  defaults:
    _controller: '\Drupal\Core\Entity\Controller\EntityListController::listing'
    entity_type: 'node_type'
    _title: 'Content types'
  requirements:
    _permission: 'administer content types'


texts:
When uploading an image that exceeds the server PHP upload image, I get the following error:

My question is: Why is this error displayed so ugly and is there a way to display it more nicely, for example, in the form itself?

To be clear: I know why this error is thrown, it's just a matter of userfriendliness.


texts: Openlayer map should highlight marker when a user hover on the views row attached to the map block display

texts: There is already one example for Gmap module (http://drupal.org/node/1108302). But I need that for Openlayers map.


texts: Getting a better handle on APC Cache Bins / code for settings.php

texts:
I've got APC up and running on my VPS and have installed the APC module on my Drupal 7 site. I followed the documentation here and added this code to my settings.php file:

$conf['cache_backends'] = array('sites/all/modules/apc/drupal_apc_cache.inc');
$conf['cache_default_class'] = 'DrupalAPCCache';
//$conf['apc_show_debug'] = TRUE;  // Remove the slashes to use debug mode.

However, on my site's status page under APC, it says:

APC has been running for 3 min 54 sec. Currently caching 0 entries (0 bytes).

To me the "0 entries" indicated that there was no cache being created / used. I did some digging around and it looks like there might be additional code I need to add but cannot find documentation anywhere.

I found this snippet but not really sure if I need it or what part it I am supposed to use and what it does, I could not find any documentation for this. I suspect this is what makes the cache work.

'page_cache_without_database' => TRUE,
        'page_cache_invoke_hooks'     => FALSE,
        'page_cache_maximum_age'      => 3600,
        'cache_lifetime'              => 0,
        /* my note -- noticed "cacherouter" in the path below
         so I am guessing this needs to be adapeted to the path for APC?? */
        'session_inc'      => './sites/all/modules/cacherouter/session.inc',
            'cache_default_class'               => 'DrupalAPCCache',
            'cache_class_cache'                 => 'DrupalAPCCache',
            'cache_class_cache_block'           => 'DrupalAPCCache',
            'cache_class_cache_bootstrap'       => 'DrupalAPCCache',
            'cache_class_cache_content'         => 'DrupalAPCCache',
            'cache_class_cache_filter'          => 'DrupalAPCCache',
            'cache_class_cache_form'            => 'DrupalAPCCache',
            'cache_class_cache_menu'            => 'DrupalAPCCache',
            'cache_class_cache_page'            => 'DrupalAPCCache',
            'cache_class_cache_pathdst'         => 'DrupalAPCCache',
            'cache_class_cache_pathsrc'         => 'DrupalAPCCache',
            'cache_class_cache_session'         => 'DrupalAPCCache',
            'cache_class_cache_session_user'    => 'DrupalAPCCache',
            'cache_class_cache_update'          => 'DrupalAPCCache',
            'cache_class_cache_users'           => 'DrupalAPCCache',
            'cache_class_cache_views'           => 'DrupalAPCCache',
            'cache_class_cache_views_data'      => 'DrupalAPCCache',
      );

Any help on this matter would be appreciated.

The information about the APC extension returned from phpinfo() are the following ones.


texts:
stdClass Object(
  [nid] => 98
  .......
  [title] => hello world!
  [body] =>
  ........
  [field_img] => Array(
    [0] => Array(
      [fid] => 200
      [list] => 1
      [data] => Array(
        [alt] =>
        [title] =>
      )

      [uid] => 1
      [filename] => coupon.jpg
      [filepath] => sites/default/files/coupon_0.jpg
      [filemime] => image/jpeg
      [filesize] => 4434
      [status] => 1
      [timestamp] => 1302080050
      [nid] => 98
      [view] =>  **the image**
      ......
    )
  )
)

Supposing the object is $test,  echo $test->field_img[0]["timestamp"] in views-view-fields.tpl.php outputs 1302080050, but echo $test->field_img[0]["nid"] and echo $test->field_img[0]["view"] don't output anything; I can't print 98 and the image. print_r($test->field_img[0]) doesn't print the node ID and view? Why?


texts: Custom module stopped executing after 30 seconds

texts:
I've written a custom module that adds many users from a database to drupal database. So, it has many database queries to take care of the drupal tables: users, user_roles, url_alias, profile and field_data_field_$fieldname and field_revision_field_$fieldname where $fieldname is the profile2 field and has many such fields.

The problem is when I execute this module (the trigger is user selects an option in the form which is specific for this module), it executed for only 30 seconds and inserted some 20+ users where I have to insert 500+ users. After 30 seconds, it didn't display any error. It stayed on the same form.

How can I clear this?


texts: make view modes for commerce enabled by default when exporting with features

texts:
I am trying to make the Drupal Commerce view modes administrator and checkout_pane enabled by default when I export with features.

I have strongarm dependency required; but I do not see the view mode options available.

Does anyone have some ideas? I would greatly appreciate the help.


texts: Remove comma from unlimited items body in content type

texts:
i have a content type with multiple body fields. It's works but there is a single comma between the body fields on the rendered page. I can't for the life of me figure out how to remove that god forsaken comma. Pls help!!!

Edit, here is an image to hopefully clarify the output issue I am having:

So, the body is an array:

I need to figure where the array is being rendered so that I can remove the comma that is being used to separate the array.


texts: Unable to add a submit button to a drupal Block

texts:
I am adding a submit button (in the callback function 'clearbutton_submit()') - when I click on the button - nothing happens.

What am I doing wrong here?

function cacheclearbutton_block_info() {

$blocks['cacheclearbutton_uppercase'] = array(
// info: The name of the block.
'info' => t('CacheClear Button Block'),
'region' => 'sidebar_first',
'status' => 1,
);

return $blocks;
}

/**
* Implements hook_block_view().
*
* This hook generates the contents of the blocks themselves.
*/
function cacheclearbutton_block_view($delta = '') {
//The $delta parameter tells us which block is being requested.
switch ($delta) {
case 'cacheclearbutton_uppercase':
  $block['subject'] = t("uppercase this please");
  $block['content'] = block_content();
}
return $block;
}

function block_content() {

$block_contents = array();

$block_contents['clearbutton'] = array(
    '#type'         => 'button',
    '#value'        => 'Clear Cache by Module',
    '#submit'       => array('clearbutton_submit'),
);

return $block_contents;
}

function clearbutton_submit($form, &$form_state) {
    cache_clear_all();
    drupal_set_message(t('Setting a message from the submit handler'));
}


texts: Specifying the default database to store new field tables in

texts:
I have a few Drupal 7 sites running on a multisite setup. They each have their own database, and there's a "shared" database used by all of them, which contains user data, date formats, filters and some other data that is shared across all of the sites.

Nodes and taxonomy are not shared, but I am looking at changing that so they are, and using a taxonomy vocab as a means of specifying which site each node is associated with.

I don't have a problem setting that up as I have a nice little database include that handles database credentials and prefixing, but there is one drawback with this setup and that is controlling which database any given module should create new tables in. I know that in order to have all sites use a single node table, I should also share the content types and fields - but I am going to run into issues when creating new fields on content types, as their respective tables will naturally be created in the site's default database and not the shared one.

So, I suppose my question is: how can I specify what the default database should be on a per-module basis?

P.S. I did consider using Domain Access to achieve this, but that doesn't seem to be suitable in this case as each site uses a separate database already, and I'm not looking to share themes, site config, blocks, views, panel data, paths, etc.


texts:
I have a user field that'll be used to save some user-specific JSON. I have ajax that uses a token with a route to get to a controller to save some JSON to the field. I basically have this:
  public function ajaxStateSave(Request $request) {
    if ($this->currentUser()->isAuthenticated()) {
      $settings = $request->getContent();

      // Save table settings to user
      $user = User::load($this->currentUser()->id());
      $user->set('field_json_settings', $settings);
      $user->save();

      return new JsonResponse("{success: true}");
    }

    return new JsonResponse(null);
  }

My question is, is this a fine way to save the JSON? And how should it be sanitized, on save here or when read back in ajax?


texts:
My website has 2 domain, example.com and example2.com.

example.com/node/1 and example2.com/node/1 are the same link.

How do I redirect example2.com to example.com.

When people open the linke example2.com/node/1, it will redirect to example.com/node/1


texts:
I have some rules created and working fine. Some of them are made for messages, that are displaying after certain period of time. And that's alright, works.
But, it also displays the message when browsing the page created in Views, that is listing all the content of X type.

So, let's say I have a work content type; Every work node older than few weeks is getting the message shown to the user. I also have a view, but I don't want the rules to display the message in there.


texts: Views and relationships for the race result listing

texts:
I am migrating a static runners page to Drupal, most of it are race results. I'm thinking to create content types for the race result and for the event (so I can reuse it for announcing events) and some taxonomies, see the image.

Now, I'd like in my view to list all race results that meet certain criteria, e.g. for the season 2014/2015 and 10k distance. The problem is that this data is referenced from the Distance and Saison taxonomies through the Event. Tried to add relationship with Event, but don't getting values for distance or saison.

Is there a way to do this? Or better idea to make Event taxonomy?


texts:
I'm running migration in Drupal 8, but got a duplicate error below.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '10b1b105-355b-3c77-8880-a0c247f826f3' for key 'node_field__uuid__value': INSERT INTO     [error]
{node} (vid, type, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array

My question, is there any configuration or a migration plugin that I have to specify in my migration config yml file to check for existing record and update if exists, if not exists then create a new record?

I'm using migration_plus module.


texts:
After upgrading from drush 6.5.0 to 8.0.1-dev through brew, the drush terminal command returns the popular

  'PDOException: SQLSTATE[HY000] [2002]' error.

The only way to make it work is to add the unix_socket line to my Drupal settings.php files for all my projects:

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'site',
      'username' => 'user',
      'password' => 'pass',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
      'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
    ),
  ),
);

Even if I use /var/mysql/mysql.sock, it will work, because I have a symlink up:

lrwxr-xr-x  1 root  wheel    39B Mar 11  2015 /var/mysql/mysql.sock -> /Applications/MAMP/tmp/mysql/mysql.sock

But that is exactly the thing I don't understand. And I would like to configure it at one point so I don't have to edit all the current and upcoming project's settings.php files.

So my question is: Where does drush look for the path of the mysql socket (on MAMP)?

If it's through the php.ini, it should be correct too (/Applications/MAMP/bin/php/php5.6.10/conf/php.ini):

mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock

Currently, my .bash_profile contains no alias or export related to this issue because it worked fine with my previous drush installation.


texts: Remove Welcome message and "No front page content has been created yet."

texts:
The home page of my website contains blocks and views only. Hence, I want to remove both of the following message-

Welcome to my web
No front page content has been created yet.

I tried to add following code as described here but I can still see the message Welcome to my web

unset($page['content']['system_main']['default_message']);


texts: How to render a block in php for a special node id

texts:
I would like to render a block from only one node on all node pages. But all the code I found to render blocks never takes the nid as an input. Is there a possibility that I can trick the block renderer into thinking it is on a different page?

If it is of any help: In my case I want to render the block for Opening hours from one node id on all pages. So I do not have to add the same opening hours for every node.


texts: advise for managing and troubleshooting modules

texts:
I think anyone using Drupal runs into this sooner or later. You're trying to get to some solution and you start adding modules. Then somethings start breaking. The last time I had this problem, I uninstalled and then reinstalled the modules by enable/reenable the check boxes on the module page.

This time I have a lot of new content types and views and wot wot, and I'm scared. (>_<) I don't know if I'll lose these bits. I've exported my views, I've dumped the database. But I'm still nervous. What advise would you give, or reassurance?


texts: Trouble Aggregating terms that are pulled through an entity_reference

texts:
Trying to create a table view listing portfolio clients, including a list of tags that are related to each client. Tags are connected via entity_references (from multiple kinds of nodes), and it's breaking aggregation.

I've got three content types: client, portfolio example, and explanation.
Example and Explanation nodes each contain tags from a "type_of_work" vocabulary.
Example and Explanation nodes each have an entity_reference targeting a client node.

I created a view listing filtered by node_type=client, no sorting, and a required relationship for referencing entity (via field_client). Then I added a field for the field_client, using the relationship, and got a list that repeats the client name once for every referencing node. Turned on aggregation, and the list shortened to one entry per client. Everything works like I expected thus far.

So I add a field for the type_of_work, again requiring the relationship. Page load error. If I kill aggregation, everything looks good (except I have an entry for each referencing node because they aren't aggregated).

Am I doing something wrong here?

EDIT:

The goal is to get single rows that contain the client in one column, and a comma-separated list of type_of_work in the other.


texts: Rules replacement pattern for image type field

texts:
I am using Rules and HTML mail module to send HTML email on various events. It is working fine, but I am getting problem in rendering image field(ie image) in email template.

I have field field:cover-photo which is of type image. This field appears under
 Replacement Pattern token section. But when I include it, in the email it shows

Property field_cover_photo

and not the image. Any idea how can I show image in email.

-- Many thanks for your time.


texts: How do I update configuration/database after a core update?

texts:
This may seem like a dumb question to some of you, I'm sure. After having worked with Drupal from version 6, I'm now for the first time using Drupal 8 and -- after some initial difficulties -- have actually come to enjoy the new development process (using Composer and Configuration Management etc.). However, I'm still failing to understand the indended workflow, after having completed a core update in my local installation. Here's my understanding, so far:

In case of simpler modifications -- like, say, having created a new content type -- I usually call drush cex on my local Drupal site, then transfer the contents of the sync directory to my staging (or production, if I'm feeling venturous) site (using FTP) and go to Configuration > Development > Configuration Synchronization to apply the changes. (Note that I can't call drush cim at this point, as I'm not able to use the terminal in my staging/production site.)
If any content has been created for that new content type in my local site, I transfer that content to staging using the Deploy module.

So far, that's working pretty well. However, how am I supposed to proceed, after having completed a bigger update that involves non-trivial modifications to the database?

Say, I'm performing a core update: composer update drupal/core --with-dependencies
I will then perform the necessary database updates locally, either by calling drush updatedb or by visiting update.php in a browser.

But then what?

Say, I'll upload all the new files via FTP to the staging site. Clearly, I cannot also copy the local database to the staging site, because the contents would be overwritten. So, I need to import the new configuration to the staging site... but accessing Configuration > Development > Configuration Synchronization to update the database will probably result in an error, exactly because the database has not been updated, yet.

This is where I'm stuck. I suspect, there's a piece to the puzzle that I'm missing, but what is it?


texts: Paypal express checkout doesn't add taxes

texts:
I am creating a site where they only want to use paypal express checkout (using drupal 7 /Ubercart 3.1). The problem is that it doesn't display the taxes when processing the order.
I know it doesn't have the address info when it goes to the express checkout but when it comes back, it adds the shipping price but no taxes.
Is there a way to add the taxes in?

I have been through all the options and don't see anything related to this.

I have also tried modifying inside the paypal module itself:

In the function uc_paypal_ec_review_form_submit I see that they add the shipping info if it is not there but when I try to add taxes the same way, the tax functions don't work.

I do see the line "subtotal excluding taxes" which I believe is being generated by the taxes module but no tax is actually applied.

If I use the paypal standard checkout, the tax is applied once the address info is filled in.

Any help would be appreciated.


texts:
I have created an angular application with headless Drupal. I am using Drupal Services module for web services call from my angular application.

My angular app contains login mechanism which is done using services call. So on login, session id, session name and token are saved and after for each request like GET, POST, PUT, I am using those stored values to authenticate the user at Drupal to do the backend logic.

This session storage is suggested at Drupal service module documentation.

So what happening to me is, on my POST and PUT call, Service module can't able to identify the user and returns "CSRF validation Failed".

On debugging the service module, in this function "_services_sessions_authenticate_call" they are allowing only certain http methods like GET, HEAD, OPTIONS. Hence my POST and PUT call is not allowed and returned as "CSRF Failed".

After modifying the code by allowing POST and PUT in that function, everything works great.

I think modifying the stable module code is not a suggested one. Am I doing anything wrong in request handling or can anyone suggest a standard way to handle authentication?


texts: How do I programmatically remove a block?

texts:
I have a custom module that is intended to be deployed as a pure web view, with no styling whatsoever beyond what I created in the .twig file.

I installed the Stark theme and in my local instance I went to Admin > Structure > Block layout to manually remove all the active blocks.

However, this module will be deployed and I will have to have it programmatically remove all blocks when integrated into the mobile client.

Is there a way to turn off any automatic/default activation of blocks?


texts: How to redirect to edit page on node create?

texts:
I am trying this code in my custom module but it does not redirect to the node edit page.

 function mymodule_entity_insert(EntityInterface $entity) {
   if ($entity instanceof \Drupal\node\NodeInterface){
        $id=$entity->id();
        return new RedirectResponse("/node/$id/edit");
      }
   }


texts: Disable delete button on a view under certain conditions

texts:
I'm very new to Drupal 7. I have an administration screen created in Views to edit/delete my custom content type called events.

In my custom module, I'd like to disable the delete button under certain conditions. Is there any hook that I can use for this purpose?

The reason I like to do this is to prevent users from deleting 'certain' events.

Inside each user profiles, there is a field that defined which stores that user can edit/view. I like to make it that when people click on the delete button, if that store is not of their stores, they shouldn't be able to delete it, they should get redirected back with an error message.

Here is the code I have so far:

function my_modue_form_alter(&$form, &$form_state, $form_id){
    dpm($form);
    dpm($form_id);

    if ($form_id == 'myformid') {
      unset($form['op']);
    }
}

On the /delete screen, it doesn't print out anything.

Here is a screen shot of how the delete node page looks like:

And here is how the URL looks like:

http://example.com/node/123/delete?destination=admin/manage-events

Thanks


texts: Using a template for a custom admin page made with hook_menu

texts:
I have developed a module in Drupal 7.

Now, I want to add a custom themed-page in the admin panel of Drupal.

I have added a page using admin_menu():

function newsletter_menu()
{
    $info = array();

    $info['admin/reports/newsletter'] = array(
        "title" => "Number of Registered Users for Newsletter",
        "description" => "",
        "page callback" => "newsletter_admin_content_block",
        'page arguments' => array('newsletter_admin'),
        'access arguments' => array('administer newsletter settings'),
        'type' => MENU_NORMAL_ITEM
    );

    return $info;
}

It works all well. But my problem is:

I have a template file newsletter.admin.tpl.php which I want to use a the template for this page. But I don't know how should I achieve it. Can anyone help?


texts:
I'd like to limit the number of nodes that an authenticated user can create.
For example users can not create more than One post for specific Content Type. I am wondering how can I do so? Thanks..


texts: Changing TinyMCE valid_elements and valid_children properties

texts:
I'm trying to get TinyMCE + WYSIWYG + D7 to produce HTML like this...

Foo

bar

According to my tests, TinyMCE can do this easily out of the box. Just create the list. Type some text, highlight Foo and select the Heading 2 format.

However, when I perform the same actions in Drupal, TinyMCE will change the entire contents of the
 to be the selected format... producing markup like this...

Foo

        bar

I expect this is because Drupal is setting the valid_children or valid_elements properties of TinyMCE but I dont see how to affect them in the configuration page.

How do I change Drupals config for these? How do I get the editor to produce the markup that I want?


texts: Webform field description to be inline, not popup

texts:
The description text on a webform text field does not display inline, but pops up in a box when you click into the field.

How do I change this so it is inline like the other fields?

Using Tweme theme


texts: Converting a Project from D6 to D7 using Drush in localhost?

texts:
I have a D6 project in my localhost

i.e   C:\wamp\www\ProjectName_6

I need to migrate the above mentioned project to D7 in the same directory using drush.

Should be like this C:\wamp\www\ProjectName_7

I am using Drush Version 5.7 which is located in the following path

C:\Documents and Settings\All Users\Application Data\Drush\

Could anyone kindly provide a step-by-step guide to complete this process or any good links which is suitable for new bie...

I googled a lot. But can't find any good article... (My search keywords may be wrong... )


texts:
Reading hook_menu it says this:

"title": Required. The untranslated title of the menu item.
"title callback": Function to generate the title; defaults to t(). If you require only the raw string to be output, set this to FALSE.
"title arguments": Arguments to send to t() or your custom callback, with path component substitution as described above.

So how to use it? Right now i have this
function custom_gmap_neo_menu(){
    $item = array();

    $item['custom_gmap_neo/%/%/%'] = array( // hotel/origin/destination
        'title' => 'Get directions to @hotel',
        'title arguments' => array(1),
        'page callback' => 'custom_gmap_neo_show',
        'page arguments' => array(1,2,3),
        'access callback' => TRUE,
    );

    return $item;
}

function custom_gmap_neo_show($hotel, $origin, $destination){
    dpm($hotel);
    dpm($origin);
    dpm($destination);

    return '';
}

So knowing that default function for title callback is t() how to actually pass the @total wildcard to the t() function?


texts:
Has anyone found a way to get megamenus working in a Bootstrap 3.x sub theme?  I have tried the various modules, plus patches to them and ports of them, with no success.  I've mostly looked at TB Megamenu, but it does not seem to be the way to go.

At this point I am tempted to just hardcode the HTML into my template(s).

Thanks,

Eric


texts: Is there a problem defining a View using a path alias? Or did I just miss something?

texts:
CONDENSED SUMMARY OF ISSUE:
I have a view with a path of /taxonomy/term/%/something that responds to a URL alias of /spec/ID/ so entering /Spec/ID or /Spec/ID/Something displays what is in the View.  If I clone the View and change the paths from /taxonomy/term/%/something to /Spec/%/Something entering a URL of /specs/ID will no longer display the view.

ADDITIONAL INFO:
I have created a View (D7 Views3) with several pages each with the path /taxonomy/term/%/sub-category where subcategory is a label for a subgroup of content for the specified term. A filter in each page limits the content to match the subcategory label.

I have created an alias for a vocabulary /specs/[term:field_specno]. The field, attached to the term, provides a unique ID for the terms relating to a client's set of standards.

If I enter a URL for /specs/term1, the view will display the correct content for term1 on a page display, with operating Menu Tabs I have defined for each page in the view. It works great except that if I select another Menu Tab, the URL changes to taxonomy/term/%/subcategory format used in the view.  This would be confusing if a user uses the URL and gets the cryptic tid instead of his ID system.  It I clone the view and change the paths to spec/[term:field_specno]/sub-categories, the view no longer displays the pages and tabs correctly.

Is there a fundamental problem in Drupal doing this or have I screwed up somehow?  Has anyone done something similar successfully?


texts: Is there an easy way to adjust the block layout?

texts: I have menus that are set to Sidebar First in the Bartik theme.  When the screen size decreases, those menus are shown below the main page content.  Which file in a copied version of the Bartik theme could I play around with to change around the block configuration as shown here:


texts: How do I get all the options of a field?

texts:
In Drupal 7, we are using the following code.

$field = field_info_field('field_name');
$allowed_values = list_allowed_values($field);

What can we use in Drupal 8?


texts: Hide view when node's taxonomy value is empty

texts:
I have two taxonomy vocabularies: departments and categories.

I created a block view to display related pages (other pages in the same department and category) using contextual filter. All works well when a node has both department and category selected. But when I leave the category empty on a node, the view still shows other pages from the same department.

Is there any way to make the view not show up on the nodes with no category?

Here is what my contextual filter looks like:


texts: When using hook_FORMID_form_alter(), how does one use validation to prevent form submission?

texts:
Here is the code I have, and while the errors do print to screen, the form will submit anyway. How do I prevent the form from finishing submitting?

function my_module_my_form_form_alter(&$form, &$form_state) {
    // calls a function during validation
    $form['#validate'][] = 'my_module_validate_address_check';
}

function my_module_validate_address_check(&$form, &$form_state){
    if($form_state['values']['panes']['delivery']['delivery_postal_code'] != 91006){
         drupal_set_message(t('Wrong Zip'), 'error');
        $return = FALSE;
    }

}


texts: Subtheme: How to use the template function of a parent theme (from inside the parent theme)

texts:
I have created a theme that contains several functions.

I now want to create a sub theme. That way, I can use the parent theme on all my sites (and any updates to the parent the theme can be easily applied to all the sites). The sub theme will contain all the modifications that are specific to that individual website.

I have created a sub theme following the instructions in this tutorial. When I enable the subtheme, the site breaks. Most of the content disappears and I get this error message:

  Fatal error: Call to undefined function legendary_views_field_compare_value() in /all/themes/legendary/templates/slideshow.tpl.php on line 20

legendary_views_field_compare_value() is the name of a function in my
parent theme.
legendary is the name of my parent theme.
slideshow.tpl.php is a template in my parent theme.

I don't understand why this is happening. I thought the sub theme should inherit all the functions of the parent theme (especially is the function is being called from inside the parent theme and NOT in the sub theme).

How can I fix this?


texts:
I need to display a text and apply the chosen filter to it. The text is saved using the text_format field type.

So I know the original text, I know the chosen format type but I don't know how to actually filter the text.

How can I programmatically filter text? Thanks


texts: Create node link in views header and open in popup

texts: Is there any option to include "Node Add" link in Views header, which to be opened in popup?


texts: How to add new reference in entity reference field in node edit form keeping old references intact and hidden?

texts:
In my project, there is a content type 'song' containing an entity reference field to reference content type 'playlist'. More than one user can edit a 'song' to add it to their own 'playlist's.

Now, when one user updates a 'song' node creating his/her references in the node edit form, the previous references made by another user are deleted. In the node edit form, the field is formatted through an entity reference view showing a list of 'playlist's only created by the current user. The number of values for the entity reference field is set to unlimited.

What would be a good and server-friendly approach to solve this problem keeping in mind that there can be an unlimited number of previous references made by other users?


texts: Can use Webform for add combobox for select language on the site?

texts:
I want to know how I can add a combobox to a page. For example, on the front page, I want to add a combobox for selecting the language. I use the default modules for creating multilingual sites. Languages are displayed as a list on the page. I want to display a combobox instead of the extended list.
Can I do this with the Webform module?


texts: Replace URL query string with slash for a cleaner URL

texts:
I have created a new content type with a body and multiple fields.

I use the following query string

?article=referral-partners

to change the content of the node's body according to the value of the value of article.

The full URL looks like this (with my path alias I created):

http://localhost/userguides/contacts/my-first-user-guide?article=referral-partners

I would like to clean up the url to look like this instead:

http://localhost/userguides/contacts/my-first-user-guide/article/referral-partners

How can I do this with Drupal 7?


texts: how to add html/ccs element s inside drupal mail function

texts:
I am developing function that send a email to user..,and i want to add some html.css styleing to the email how can i achive that folllwing is my code i tried

function zgcrons_mail ($key, &$message, $params) {
  switch ($key) {
  case 'mymail':
    // Set headers etc
    $message['to'] = $usermail;
    $message['subject'] = t('Your Donation Statues ');
    $message['body'][] = '

&nbsp;
                follow on Twitter |
                friend on Facebook

                Copyright &copy; 2012 Zealous Good, All rights reserved.

';
  break;
  }
}
drupal_mail('zgcrons', 'mymail',$usermail, $language, $params = array('username' =>'John Potato'), $from = NULL, $send = TRUE);


texts: create panel page for taxonomy term page

texts:
How to create panel for taxonomy term page using Page Manager in Drupal 8.
I've created page with path /taxonomy/term/{taxonomy_term} but it doesn't work and displays default taxonomy page template.


texts: How can I hide fields by user role when viewing a node?

texts:
I have managed to hide certain fields for certain roles programmatically in Drupal 8 using function module_name_form_node_form_alter(array &$form, FormStateInterface &$form_state, $form_id).

The matter is that what I managed to hide such fields in the "Edit" tab, but I would also like to do the same in the "View" tab. What I intend to do is to hide certain fields depending on their machine name and the role of the user logged.

Do any of you know which hook should I use for that?


texts: How to get "empty line items" in Commerce, similar to Ubercart?

texts:
In Ubercart, there is a little feature for adding "empty line items" to an admin created order. This allowed an admin to manually enter a custom title for the line item and a custom amount. Essentially allowing you to add line items without going through the process of creating a product first, then attaching it to the order. Very helpful for creating invoices for custom services. Is there any way I can get this feature in Drupal Commerce?

This is how it looks and works in Ubercart:


texts: Proper way to create image field in a content entity

texts:
My site allows users to upload images and add title and description to it. So I make a new class which extends ContentEntityBase. In its baseFieldDefinitions() method, I put an image field beside title and description fields:

$fields['image'] = BaseFieldDefinition::create('image')
  ->setLabel(t('Image'))
  ->setRequired(TRUE);

I expect to see a file/image upload control in the add/edit form, but I don't see it. I see only the title and description textboxes.

I tried to find "create('image')" in all Drupal source code but didn't see any examples. So I don't know if creating an image field like this is the proper way or not?


texts: Render a view in a given language in a custom command

texts:
I have written a Drupal Console command that creates a huge batch of HTML snippets. This is done by rendering a view programmatically (as in this StackExchange answer)

The task

Now I have to create these snippets in several languages.

This works

If I call the view in my browser I can easily chose the language with the respective path prefix:

http://www.example.com/de/path/to/the/view (german version)

http://www.example.com/en/path/to/the/view (english version)

This does not work

If I try to render the very same view from a Drupal Console command I am not able to set the target language. The rendered HTML is always in the default language.

At first I thought passing the langcode in the view() method should suffice:

// Now render the node as HTML
$viewBuilder = $this->entityTypeManager->getViewBuilder('node');
$build       = $viewBuilder->view($node, 'full', $langcode);
$html        = $this->renderer->renderPlain($build);

Then I tried setConfigOverrideLanguage():

$this->languageManager->setConfigOverrideLanguage($language);

// … render the view here …

$this->languageManager->setConfigOverrideLanguage($originalLanguage);

But this did not work either. So it tried:

$this->configFactory->getEditable('system.site')->set('langcode', $langcode)->save();

// … render the view here …

$this->configFactory->getEditable('system.site')->set('langcode', $originalLangcode)->save();

But I did not succeed. I even tried using a custom LanguageNegotiator, but I ran into a fatal error due to the fact that the service 'language_manager' does not implement the ConfigurableLanguageManagerInterface, so it is missing the setNegotiator() and getNegotiator() methods.

Once again I am totally stuck and I don't know what I am missing (most likely just a tiny bit). How in the world is it possible to change the language of my rendered HTML???

Edit 2017-01-05:

I have to admit I am quite desperate atm. I even tried everything I ruled out above again. Guess what, it still does not work. Any ideas? I am so shure that I am missing only a tiny piece. But I don't have any idea where to search for :(

Edit 2017-01-17:

Obviously the console command is not aware of (parts of) the context, even if I set the language. Just to get it done I am considering putting together a request object which I would then have been handled by the kernel. If this should turn out to be too complicated I could still curl the respective pages, but I have a feeling that there should be another way of doing this.

Edit 2017-03-14:

First of all there there has to be a translation (even if the node data is in no way language specific). If you want the complete context you have to use the Kernel's handle method with a sub request.


texts: Why are my taxonomy icons in views showing for admin users but not for other users?

texts:
I have a site that uses Views to display node 'teasers' to users. They then click a node title to view the node itself. I have a search-based View as well as several list views that show different sets of the same nodes.

All the Views show 1-2 small icons for the node, a linked title, and a description and sometimes a location and date. Everything was working fine...until it wasn't, and I have no idea what changed.

Actually, everything IS working fine if you're logged in as the admin user...however for all other users one of the icons doesn't show anymore. After weeks of troubleshooting I've determined it has to be a module or database issue somehow. I figured this because when I re-wrote my local development database with a backup from July the icons shows for all users now.

I've determined that all the modules on both development AND the production site are all the same and the same versions too. I tried changing the theme to Bartik to see if maybe that was causing a problem...doesn't work on Bartik either, so it's not a theme issue.

The images are both attached to the nodes as term reference fields (because they are coming from taxonomies). I've compared the two taxonomies settings and both are identical (except with different icons). I also have a custom module that gives recommendations to users and DOES show the icons to all users and works fine. So I know it's not a matter of permissions to see the images and I know they are there and working correctly when just using php in a custom module. Also I've made sure permissions on the Views are set to show to to whomever can view published content (and users can definitely see published content). I tried setting it to 'roles' also and that didn't help either.

I also examined the SQL for one of the Views thinking maybe that might be an issue, and determined the SQL is exactly the same in PROD and DEV. Here's the SQL:

    SELECT node.nid AS nid, node.title AS node_title, 'node' AS
field_data_field_icon_node_entity_type, 'node' AS
field_data_field_price_node_entity_type, 'node' AS
field_data_body_node_entity_type
    FROM
    {node} node
    INNER JOIN {field_data_field_type} field_data_field_type ON node.nid =
field_data_field_type.entity_id AND (field_data_field_type.entity_type =
'node' AND field_data_field_type.deleted = '0')
    WHERE (( (node.status = '1') AND (node.type IN  ('resource')) AND
(field_data_field_type.field_type_value = '4') ))
    ORDER BY node_title ASC
    LIMIT 10 OFFSET 0

I'm now trying to figure out where the database problem might be. I've so far compared the following entries and they are all the same:

taxonomy_vocabulary
views-view
taxonomy_index
field-data-field-taxonomy-icon
node

See my screenshots below to see what I mean. ADMIN users can see the little red icons while all other users cannot.

How results look for logged-in users:

How results look for anonymous users:

Not sure what else to look at. Thoughts? Suggestions?

I'm pulling my hair out here.


texts:
I received the following error using my module:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '%m-%d') =
DATE_FORMAT(NOW(), '%Y-%m-%d') AND is_logout = 0' at line 1: SELECT id FROM
ap_visits WHERE`current_ip` = '192.168.1.1' AND `url` =
'http://www.mysite.com/php/4220/how-build-shopping-cart-w-checkout-php.html''
AND DATE_FORMAT(date_start, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d') AND
is_logout = 0; Array ( ) in test_module_check()
(line 164 of /var/www/clients/client1/web2/web/sites/all/modules/test_module/test_module.module).

The error here is in the value of url column. It has an apostrophe at the end. So my question is on how can I escape this value so the apostrophe will not be an issue?

I am using db_query. This is my code:

$sql = "SELECT id FROM ap_visits WHERE`current_ip` = '$current_ip' AND `url` = '$url' AND DATE_FORMAT(date_start, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')  AND is_logout = 0";

$result = db_query($sql);


texts: How to get Signatures for Forums using SQL query?

texts:
In a D7 site, I'd like to get all of the user signatures using raw mysql query .
I've found a signature_forum_post table but could not figure out how to make a query that returns both user.id and signature text, so appreciate your help.


texts: move script declared in panels under  tag

texts:
I have some google survey code that I have included in one of my panel node variants. The js code has some php in it, to include the node nid and node title. Im trying to move this code, declared in a script tag, right under the  tag of the document via js/jquery. I have fussed and fussed with this for a couple of days on and off, and I still cant figure it out. I know the solution is probably really simplem bu please help!

The code:

<script type="text/javascript">
(function() {
  var ARTICLE_URL = '<?php print "http://www.example.com/".$url; ?>';
  var CONTENT_ID = '<?php print $nid; ?>'; // Optional or leave empty
  document.write(
    '<scr'+'ipt '+
    'src="//clients4.google.com/survey?site=5099007'+
    '&amp;url='+encodeURIComponent(ARTICLE_URL)+
    (CONTENT_ID ? '&amp;cid='+encodeURIComponent(CONTENT_ID) : '')+
    '&amp;random='+(new Date).getTime()+
    '" type="text/javascript">'+'\x3C/scr'+'ipt>');
})();
</script>

Basically I need the js script at document load time, with rendered php, to move under the body tag.


texts: How do I group taxonomy by hierarchy, not node?

texts:
I am using Drupal 7 and Views.

I'm trying to use the generic Taxonomy/Term view and get a grouping I don't want.
I want this:

Taxonomy 1:

Node A
Node B

Taxonomy 2:

Node B
Node C

(Notice Node B is in both taxonomies.)

What I'm getting is the following one:

Taxonomy 1:

Node A

Taxonomy 2:

Node C

Taxonomy 1, Taxonomy 2

Node B

How do I get the first example to display,  where Node B just appears under the different Taxonomies and doesn't create a new heading with multiple taxonomies?


texts:
I am trying to set the value of a user field which is a date. If i check the database, the date is in this format:

2016-06-30T07:52:51

I have the user ID and a new Unix timestamp value that I want to overwrite the existing value with.

The following shows no error messages but does not change the date

$account = \Drupal\user\Entity\User::load($email_result); // pass your uid
$account->set('field_expiry_date',strval(date('c',($new_expiry))));

//$field = $account->field_expiry_date;
//$field->set(date('c',($new_expiry)));
//$field = $account->get('field_expiry_date');
//$field->setValue(date('c',($new_expiry)));

What is wrong with this code?


texts:
I am using superfish menu module with drupal 7.7 and I can't figure out how to override the CSS in space.css or any other superfish stylesheet.
If anyone knows how to, please share your input.


texts:
How can I hide, disable or un-publish some term in a taxonomy? The term should not be displayed in published nodes.

There is the module Taxonomy Term Status for Drupal 7. Maybe there is something similar for Drupal 8 as well.


texts: How to create mutliple order statuses in Ubercart?

texts:
Is it possible to create multiple order statuses?

I.e. order can be "In checkout" and "Paid" (I have a list with few parameters which may be set to true or false).

My software: Drupal 7.24, Ubercart 3.6


texts:
in short I want the same functionality as the taxonomy module where you can have an URL like "localhost/drupal/admin/structure/taxonomy/occupational_fields/edit"
where occupational_fields was the aliased part.

The menu entry in taxonomy for the page callback looks like this:

$items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/edit'] = array(
  'title' => 'Edit',
  'page callback' => 'drupal_get_form',
  'page arguments' => array('taxonomy_form_vocabulary', 3),
  'access arguments' => array('administer taxonomy'),
  'type' => MENU_LOCAL_TASK,
  'weight' => -10,
  'file' => 'taxonomy.admin.inc',
);

The function declaration looks like this:

function taxonomy_form_vocabulary($form, &$form_state, $edit = array())

Now my implementation looks like this:

$items['admin/config/mapper/%tid/edit'] = array(
  'title'            => 'Mapper edit mapping',
  'description'      => 'Add or edit a mapping',
  'page callback'    => 'drupal_get_form',
  'page arguments'   => array('mapper_form_mappings', 3),
  'access arguments' => array('administer site configuration'),
  'type'             => MENU_LOCAL_TASK,
  'file'             => 'mapper.admin.inc',
);

And respectively:

function mapper_form_mappings($form, &$form_state, $edit = array())

But when an URL like "localhost/drupal/admin/config/mapper/11/edit" is opened
the function above is not called.

I tried googling a good URL alias tutorial for module programming, but couldn't find one. Maybe I searched for the wrong thing?

edit: I can imagine that I need some type of handler, but I couldn't find one in the taxonomy files and the tutorials didn't mention them either.


texts: what is the difference between render() and drupal_render()?

texts:
what is the difference between render() and drupal_render() anyway ?
Is there a reason to use only drupal_render()?


texts: Change input value on click when there is more than one paragraph

texts:
There are two fields on my paragraph.

A number field
A text field

I want to change the value of the text field when I click on the number field.

Here's my script so far which is only good on the first paragraph because of field_my_content_paragraph_field[0]:

/**
 * @file
 * Javascript behaviors.
 */

(function ($, Drupal) {

  "use strict";

  /**
   * Handle paragraph fields on the node edit form.
   */
  Drupal.behaviors.myBehavior = {

    attach: function (context) {
      $('input[name="field_my_content_paragraph_field[0][subform][field_my_number_integer_field][0][value]"]', context).on('click', function () {
        var myNumberFieldValue = $('input[name="field_my_content_paragraph_field[0][subform][field_my_number_integer_field][0][value]"]').val();
        var myInputTextFieldValue = $('input[name="field_my_content_paragraph_field[0][subform][field_my_input_text_field][0][value]"]');

        switch (myNumberFieldValue) {
          case '1':
            myInputTextFieldValue.val('A');
            break;
          case '2':
            myInputTextFieldValue.val('B');
            break;
          case '3':
            myInputTextFieldValue.val('C');
            break;
        }
      });
    }
  };

})(jQuery, Drupal);

When there is a second paragraph on the node, the field names for the second paragraph are:

name="field_my_content_paragraph_field[1][subform][field_my_number_integer_field][0][value]"

name="field_my_content_paragraph_field[1][subform][field_my_input_text_field][0][value]"

How can I loop through the paragraphs, (or is it the DOM at this point?) so the text field value of the paragraph I'm in is changed on click?


texts: UberCard on D7. Not displaying the Username or Password correctly on new account

texts:
hi all I'm using the ubercard module to setup a shop, all is working well, but at the end of a transaction there is a page which tells the user they have a new username and password which they can use to logon. This isn't being displayed all that is coming though is the special tokens !new_user_name and !new_password. I can't work out why its doing this, does anyone have a similar experience or is using this succesfully?

cheers


texts: Choose Checkbox Insted of radio as a widget in drupal custom content type

texts:
While adding field in content type I had chosen Check boxes/radio buttons as widget.
By default it takes radio button as a widget.I want check boxes as a widget instead of Radio Button. What should I do?


texts:
the following is my js file mymodule.js

$(document).ready(function(){

    alert('test');
});

and i just add this file in my customtheme.info .

scripts[] = js/mymodule.js

However, the js code only be executed at some pages, not all pages.

What could the problem will be?

Does anyone have the same situation before?

Please help me fix this.


texts: translate(localize) specific title of web form use preprocess func

texts:
I have specific webform call careers , i have use webform localization model but the model does not translate the node title , some one told me to use  preprocess node func. but i did not now how to create theme i try to write some thing like this

function [themeName]_preprocess_page(&$variables) {
  if($node['id'] == 6) {
  $node['title'] = t($node['title']);
    }

But it does not work


texts: Uploading Image to s3 turns to horizontal always

texts:
I am using s3fs module to put images on s3bucket using image field in any content type.

When I take a verticle picture, upload it to the s3bucket, it turns to horizontal.
On local file system, it works fine, but not on s3. Any idea what could be the reason?


texts: Is it redundant to use the "boost" module if varnish is used?

texts: We run our Drupal instances behind a Varnish server, but we're looking at alternative/additional ways to speed up the site. Boost is a module that is frequently named for this purpose; it appears to generate static versions of pages and serve those to avoid regeneration time, but—if we're already caching with varnish—does this give us any benefit?


texts: theme_image_style() doesn't output what is expected

texts:
I have a module that doesn't seems to work correctly, so I dived into its code, and there is something that I don't understand:

The module does something like this: (I replaced the 'path' key with an hardcoded value to show the problem)

$params = array(
    'style_name' => $presetname,
    //'path' => $image_url,
    'path' => "public://images/image.jpg",
    'attributes' => $attributes,
    );

Then $param is sent to the theme_image_style() hook

$img = theme('image_style', $params);

The problem is that if i dump the output of theme_image_style():

dpm( $img);

then i get

<img typeof="foaf:Image" src="http://mysite.local/sites/default/files/styles//public/images/image.jpg?itok=qZxUAGIS" alt="" data-thmr="thmr_99 thmr_100" />

In admin/config/media/file-system, my public path is set as: sites/default/files

I should have:

src="http://mysite.local/sites/default/files/images/image.jpg

instead of:

src="http://mysite.local/sites/default/files/styles//public/images/image.jpg

Why does the theme function add 'styles//public' and where could I remove this?

Thanx in advance for your help


texts:
I have a form which is built using some data which is partially random. Unfortunately, at the first AJAX call (nothing has been submitted yet, neither AJAX, nor in the normal way) the form will be rebuilt so that all random inputs are lost. Is there any way to avoid it?

class AjaxTestForm extends FormBase {

  public function getFormId() {
    return 'ajax_text_form';
  }

  public function buildForm(array $form, FormStateInterface $form_state) {
    $options = $this->_getOptions();
    $form['select'] = [
      '#type' => 'select',
      '#title' => 'Select',
      '#options' => $options,
      '#ajax' => [
        'callback' => [$this, 'ajaxCallback'],
      ],
      '#empty_option' => 'Please select',
      '#required' => TRUE,
    ];
    $form['submit'] = [
      '#type' => 'submit',
      '#value' => 'Save',
    ];
    $form_state->set('ajaxoptions', $options);
    return $form;
  }

  private function _getOptions()
  {
    // Actually data from an external Controller
    // But those, too, are random
    $options = [
      mt_rand(1000, 9999),
      mt_rand(1000, 9999),
      mt_rand(1000, 9999),
    ];
    return $options;
  }

  public function submitForm(array &$form, FormStateInterface $form_state) {
    // Do nothing
  }

  public function ajaxCallback($form, $form_state)
  {
    print_r($form_state->getValue('select'));
    echo "\n";
    print_r($form['select']['#options']);
    print_r($form_state->get('ajaxoptions'));
  }

}

When the user selects an option, in the Ajax callback (or Ajax submit, if I had one) I can't know which options were originally in the select box available.
Is there any way to preserve that information?


texts: Views: Get nodes of last added Node Reference

texts:
I'm working on a online magazine in drupal.
I have one content type called issue with one field, the title field.
And I have a content type called article the default drupal content type with a node reference field linking to issue.

I first make an issue called 'issue 01'. Then I start making some articles linked to 'issue 1' via the node reference field.

Then I make a second issue called 'issue 02'. And make some articles to go with this issue.

Now I want to make a view to show on the homepage showing all articles of the last added issue so for 'issue 02'. And when I would add a new issue called 'issue 03' the home page should automatically show the articles from this issue.

I'm trying to make this work via the relationship option and the contextual filter option in Views, the relationship is made. And the view is showing all articles. Now I want it to be filtered to showing articles of the last issue only so I thought about using the contextual filter but I can't find out a way to get, for instance, the NID of the last added issue.

Any help is welcome!
Thanks in advance.


texts: How to create a views grid display with "promoted regions" inside?

texts:
I need to create a grid view with a special display. The view is a normal grid of nodes obeying the filters set up for this view.

However, there are 2 promoted spots on the grid that display items with a different size.

These items need to be chosen by the administrator of the site.
I was thinking using a node queue for this purpose, but I'm not sure how to create the display to integrate it inside.

Do you have any advice?


texts: How to set a placeholder to a form element in a exposed view filter?

texts: I have an exposed view filter in a view and I need to put one element label as a placeholder in his edit form element. How can I achieve that?


texts: Disable validation when previous button is pressed

texts:
I have a multistep webform with required fields. The problem is that when I press the "previous"button in order to go to the page before the validation triggers and does not allow me to change the page. How can I disable the validation if the "previous" button is pressed?

I followed this question but it didnt work by adding this code:

if(isset($form['actions']['wizard_prev'])){
  $form['actions']['wizard_prev']['#validate'] = ['::noValidate'];
}


texts: How can I filter the entire contents of a site by region?

texts:
I have a classifieds site that I created at http://www.gastonia.com.  I've introduced the location module, and I am using views to search by proximity after someone types in a zipcode and distance. Everything is working fine.

I now want to experiment with filtering the entire site's displayed contents - all pages, all blocks, all views, all menus, etc. When someone types in their zip code and hits submit, every item of content is filtered for them within 25 miles of their region.

I can easily do this with Views and filters, even for blocks where arguments don't work.  I also want to do this for all 770 towns in my state, which means creating views programatically.  Each would have its own page / url title like Gastonia-NC and Shelby-NC and show items accordingly.

I  have created the script to do that - loop through all 770, and everything actually works, except it's slow, to say the least. Maybe there is a better way to do this?  Note the production site does not have the location / filter implemented, just my dev.


texts: I have an exposed sort in a view, sorting by title, that I want a user to be able to disable.  If they disable it, it will fall back on a sorting order that is not exposed.  Is there any way to do this?


texts: One field (entity reference - paragraph) with two display modes

texts:
I am having issue with displaying one field twice in my template having different display modes.

I have a content type basic page with field field_gallery (which is entity reference on paragraph). In template node--page--full.html.twig I want to render field_gallery twice. Once using default display mode and second using teaser.

<div class="container">
    {# this as teaser #}
    {{ content.field_gallery }}

    {# this as default or whatever #}
    {{ content.field_gallery }}
</div>

I tried do it using hook_preprocess_node, but could not achieve the result I want.

$variables['custom_display_mode'] = $variables['node']->get('field_gallery')
    ->view(array(
       'label' => 'hidden',
       'type' => 'teaser'
));

I do not want to use any custom module, I'm kinda new to drupal hooks and i'm sure that it must be possible somehow, to set custom variable and print it in my template.

Thanks.


texts: I need to track all clicks by a user (even with no JavaScript enabled.  What is the best hook_ function to use to track these requests so I may log them?


texts: How to drush enable a module only if is not installed

texts:
I would like to drush enable a bunch of modules in a certain environment via a shell script that runs EVERY TIME the environment rebuilds when new code is committed. (This saves me from having to have access to a drush terminal when I want to first install a module in an environment, but means I don't know if module is being enabled for the first time or if it was enabled long ago)

I'm concerned there might be consequences of repeatedly enabling already enabled modules. Is this true?

If yes, I'm trying to find a drush command to enable a module only if it's not already enabled.

For example, I have seen this page:

drush en `drush pm-list --status="disabled,not installed" --pipe`

which enables all disabled modules.

and

drush dis `cat tmp.txt` --yes

which disables all modules listed in tmp.txt

I want something like:

drush en `magicfunction(tmp.txt, `drush pm-list --status="disabled" --pipe`)`

where magicfunction is some linux command line magic that returns the names of modules listed in tmp.txt that are also in the list of not enabled modules.

Any ideas?


texts: Page Manager user/%user/edit selection rule only called when user has 'administer users' permission

texts:
I have a page manager page for user/%user/edit.

This page has a selection rule, for which I wrote a ctools access plugin.

(In my case the selection rule checks if the logged in user is the owner of an organic group, and the user being viewed is a member of that group).

The problem I have is that I get access denied.

In the debugger, the code does not even touch the ctools access plugin. It just checks if the user role has permission 'administer users'. The role doesn't have this permission, so I get access denied.

Interestingly, if I give the role the 'administer users' permission, then the code in my ctools access plugin runs!

In other words, page_manager_user_edit_page() is hit when the user has permission to get to the page anyway. What I need to happen is for page_manager_user_edit_page() to be hit always, because of course my og owners do not have global 'administer users' permission.

EDIT:

I ended up fixing the problem using hook_menu_alter() to call the function in the ctools access plugin.

In my case, it looks like this - I have a custom module (sites/all/modules/custom/og_user_admin/og_user_admin.module) where I call the access function.

 function og_user_admin_menu_alter(&$items) {
   $items['user/%user/edit']['access callback'] = 'og_user_admin_access_edit_callback';
 }


texts:
I used quiz module version 7.x-4.0-rc2 and drupal7 to create content in my site. I created student role to access quiz content.

I want each student can start only one quiz per day. Example: Today is 22/04/12, a student can start only one quiz. If they open and start quiz1, they can't start any other quiz until to 23/04/2012.

Please help me, How to do that.
Thank you so much,
Bien Hoang


texts:
So i know there are answers around not using Webform, but i require the reporting and tracking functionality of webform, so please stick to using it.

I am needing to create a node based on a questionnaire that is filled out so i can then display the answers of each submission in a list view/ detailed view setup. they are stories that users are able to tell to the world then have displayed on the site.

Any ideas?


texts: How to use Commerce Feeds to Import Stock for the Commerce Stock module?

texts:
I have the Commerce Stock module enabled for my products in Drupal Commerce.

But I cannot import data to the stock fields: When I set up the correct product processor, I can't see the Stock field which is present in my product variation type.


texts: Views - Combining Fields into a single link?

texts:
I'm using the Views module to build some views for our company's locations and employees.  What I've got set up is:  when a user looks at a page for one of our locations, they get a list of employees there.  The 'Employee' content type is set up with separate fields such as "Last Name", "First Name", "Middle Init" and so forth.

What I want to do is to find a way to combine these fields in a single line that forms a link to the employee's profile when clicked.

I've found I can do this by changing the "Title" field to something like "Display Name" and adding that field to the view (as the title field gives you the option to link back to the original content), but I'd really rather do it the other way as the data for the content type is imported and I'd rather not sift through all that to add a "Display" field and everything that goes along with it.

Any ideas or am I out of luck?


texts: I have created a text box with button to search the node which has the key word given in text box. Is there any possible to search the node in Drupal 7 with custom search button and textbox which is in tpl file


texts:
In drupal 7 I created new content type and also created new view to display nodes of this content type. After playing a bit with Calendar module I managed somehow to put link to calendar to node teaser links. Now I can see "Read more" link inline with "Calendar" link. It's pointing to calendar view which no longer exists.

Could you please advise me how to get rid of this "Calenar" link in teaser links? When I uncheck "Display links" in view settings (Edit View -> Format -> Show -> Content | Teaser), it disappears together with "Read more" link. But I'd like to have "Read more" link without "Calendar" link.

Thanks for any suggestions.


texts: Get username in custom user twig template

texts: I have a twig template for the compact display of a user where I am able to output the defined content fields. Is there a way to output the username of that user?


texts: Create a custom function to convert a field data

texts:
In Drupal 7, I can create a custom function in the template.php file. here is an example of custom function:

function myCustomFunction($arg) {
    $data_converted = $arg . 'XXXXX';
    return $data_converted;
}

...and in Drupal 7 and inside my template I can call this function with passing a specific data / field data.

In Drupal 8, it's different, and I don't see how to proceed. In my .theme file, I tried to create a custom function. In my twig template I tried to call this custom function but I get an error : function not found.

With drupal 8 how can I proceed to implement a custom function (with args) ?
Thanks for your help, and eventualy yours examples.


texts:
I am hoping this is a simple problem. I have Drupal 7.12 and MySQL 5.1.61 running on CentOS 6. I get the following error upon saving an article with Taxonomy. Has anyone run into this problem? I am hoping it is fairly simple to fix. The only Drupal module I've added is LDAP.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to
use near '))' at line 2: SELECT base.tid AS tid, base.vid AS vid,
base.name AS name, base.description AS description,base.format
AS format, base.weight AS weight, v.machine_name
AS vocabulary_machine_name FROM {taxonomy_term_data} base
INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE
(base.name LIKE :db_condition_placeholder_0 ESCAPE '\\')
AND (base.vid IN ()) ; Array ( [:db_condition_placeholder_0] => Exxon )
in DrupalDefaultEntityController->load() (line 196 of /var/www/html/includes/entity.inc).


texts: Newbie - I want to trigger an action when a user creates / updates a profile

texts:
I would like to trigger an action when a user creates or updates a profile.

What classes should I look for?

I search for the documentation but I didn't understand it much. Can you point me to the right direction?

Thanks a lot


texts: Large ecommerce sites that are built on drupal

texts:
I'm having trouble trying to convince the team to adopt Drupal commerce/Ubercart.
Would anyone know of some large websites that are built on Drupal?


texts: loop view fields inside views-view--[view-name]--page.tpl

texts:
I'm within the template views-view--[view-name]--page.tpl and I want to fully style the fields within the templates. So I do var_dump($variables) and within this I can see all my nodes seem to be there, but there so deep within the structure it's impossible to see where exactly, plus this can't be the correct way to loop around it as I'd have a crazy long query!

So how do I simply loop around the view in the template I mentioned and get lets say the title and the body for the nodes in my view?


texts: Alternative to the need for dozens of roles to access special materials

texts:
My organization wants to create access to specific resources and materials based on a role, but the issue is that there is the potential for dozens of such roles, each granting access to specific materials.

Is there a better way to manage this without having to have dozens of roles and permissions in the system, such as to use taxonomy or something else that is set up to accommodate such a volume?

Scenario:

A user can access our site and pay for and subscribe for special access to sections A, B, and C, each separately. Then we would need a way to track who has paid for access to which sections. I believe the section would include text, downloads, and possibly a forum and training videos.

Note: CiviCRM takes and tracks payments and memberships.


texts: How to create a rule that grants user points after a user passed a quiz?

texts:
I'm using Drupal 7 and the Quiz module (version 7.x.5.x).

I'd like to grant User Points to a user whenever a user answers correctly. I have to use the Rules module and I wonder how I can create a Rule for it, like what's the Rules Event, the Rules Condition(s), etc...).

Note that I have set the percentage of passing at 75%.

I prefer not to code anything or use the Quiz userpoints module because I had some troubles in the past with this Quiz userpoints module.

Update: I tried the 2nd rule included in revision 2 of the answer below. But it only grants the points whenever users take a test, no matter whether they passed it or failed it.


texts:
My problem is simple though multiple solutions touch upon it but none address it directly. Hence posting this question.

Problem: I have multiple servlet urls (hosted at external web server)
that returns a single image in response stream. My task is to embed
images from these (precisely 6) URLs in my drupal site. How can I do
that.
Attempts: I tried using Media Module, Embedd Media Module,
Custom formatters but none worked for me (may be because I'm a
beginner). If anyone can help me with some sort of link of steps to achieve this.


texts: How to select sub-terms in taxonomy when creating content?

texts:
In creating a document management system I've created a taxonomy vocabulary with this structure:

Accounting
  Client 1
  Client 2
Client 1
  Contacts
Client 2
  Contacts
  Correspondance
Leasing
  Client 1
  Client 2

Then, in my Document content type I've created a term reference field called Tags which uses autocomplete. The autocomplete part works great, but I don't know how to differentiate Accounting:Client 1 from Leasing:Client 1 from Client 1 (parent level). When loading a new document, is there a way to reference these terms properly?


texts: Taxonomy Alphabetical Sorting - Nested or Multi-Level Terms

texts: I have a problem with the taxonomy list. Currently my website's taxonomy is unsorted, and I want to do an alphabetical sort. It is also a multi-level nested list (3 levels). I heard that using 'Reset to alphabetical' button would sort the list as a whole, and not sorting it within the sub-levels. Is there a way to address that? Currently I'm doing a drag-and-drop sort manually, but there are tons of terms and I'd appreciate any help with that! Thanks!


texts: what can be removed when minimizing hook_views_default_views in a module?

texts:
I'm working on a new drupal 6.x module (currently in sandbox awaiting review - http://drupal.org/sandbox/sdague/1072704) which exports it's data via views.  When I implemented hook_views_default_views() I just used the export functionality on views for a few basic views to get things started.

That works, but those are both very verbose, and don't implement any i18n. Is there a standard way of trimming down the default values in those views so this becomes a bit more sane and maintainable?


texts:
Hitting my head against the wall here. I've volunteered to print a list of the current menu items (at the same level as the currently viewed menu)

print theme('links', $secondary_links, array('class' => 'links', 'id' => 'subnav'));

Does anyone know how I would print out a list of the menu items at the currently selected level rather than just the top level primary links?

Update:
Also just prints the children of the primary link parent.

      print theme('links', $primary_links, array('class' => 'links'))


texts: Why is Drupal not sending email from Webform?

texts:
I have entered my email in webform > Emails tab. After I submit the form, I do not get any email. I am just stuck. I submitted the form many times and I got no emails.

Any advise?

Webform: 7.x-4.16

PHP     5.4.45

Drupal: 7.56

Update:

From name and from email are blank. Still same issue.

Password reset does not send any email.

I also checked with hosting provider. They told me everything works on their end.

Check the recent log. After I submit a form, I do not see anything there regarding the submission.

Update

Installed the https://www.drupal.org/project/mail_logger  module.

Installed https://www.drupal.org/project/maillog module but not sure how to use it yet.

mysite.com/user. Requested for a new password.
Went to recent log. I saw it in the log.
Went to outgoing mail log. I saw it in the queue.
Checked the gmail. Got no email.
Gone thru modules. Did not see any email related module.
Submitted a webform.
Recent log > does not show it.
Outgoing mail > shows it.
Nothing is going to email including spam.
https://www.drupal.org/project/reroute_email Using this module, nothing was rerouted after submitting a webform.
This is not a new installation. This happened after migration. Below are the steps taken to migrate. I dont have the problem in source. I have email issue in target.

1) On the source server, upload the backup and migrate module
2) On the source server, take a backup of the database using the B&M module
3) Copy all the site files - Drupal core, modules, themes, and your files folder, and migrate them to the target server in the exact same folder structure as the source server.
(make sure source sites/default folder is write only access)
4) After you have migrated all the files to the target server, delete settings.php, and make a copy default.settings.php called settings.php
5) Install Drupal as a new installation on the target server
6) Enable the backup and migrate module on the target server
7) Use the B&M module to import the database backup you took in step 2

Update

Enabled SMTP

Configured as follows. Not sure if it was a correct config.

Turn this module on or off : On

Turn on delivery of emails : on

Send mail by queue. checked.

Retry sending mail on error. checked.

SMTP server: smtp.gmail.com

Backup SMTP: blank

SMTP port : 465

Use encrypted protocol : no

SMTP Authentication: user name field: my gmail user name

Password: gmail password

E-mail options

E-mail from address: entered workspace email with different domain

email from name: test

SMTP client settings: blank
Send test e-mail: info@domainexample.com

Once save the configuration, I get this:

SMTP.module is active.
The configuration options have been saved.
A test e-mail has been sent to info@domainexample.com. You may want to check the logs for any error messages.
SMTP.module is active.

Checked the email

info@domainexample.com. No email received.

Recent log shows

"smtp   01/16/2018 - 13:55  Queue sending mail to: info@domainexample.com   admin"

Submitted request password and a webform.

Got no email.

recent log:

smtp    01/16/2018 - 14:05  Queue sending mail to: info@domainexample.com   Anonymous (not verified)
smtp    01/16/2018 - 14:03  Password reset instructions mailed to admin at info...  Anonymous (not verified)

Message from hosting provider:

"
loaded php mail script and sent test email to info@domainexample.com.

serevers are working correctly. "

Still no luck.


texts: Drupal fails to send password reset mail

texts:
Drupal (7 and 8) does not send mail from password reset form and I can not find any bug or failure. More interesting is that it does send mail notification that there is new drupal version.

I have checked following with positive results:

send mail from system
send mail from PHP CLI
send mail from PHP CLI as wwwrun user
send mail from php script in standard php webpage with mail() function.

I have separate /etc/msmtprc config file for apache and only apache can read it.

Apache php.ini contains:

error_log = /var/log/php_errors.log
sendmail_path = "/usr/bin/msmtp -C /etc/msmtprc_apache -t"
mail.log = /var/log/php_mail_errors.log

settings.php contains

ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(E_ALL);
$conf['error_level'] = 2;

Successful mails are logged in mail log. No failures. Apache error log and php log shows no errors. There are no significant entries in drupal database log.

If I change something in apache msmtprc configuration none of the mails from php are successful. Msmtp correctly relays on gmail with tls.

There is absolutely no indication of error. It seems that everything is OK from the system side but drupal still fails to send the password reset message. (Message is not in the spam nor sent items folder.)

Probably important note is that drupal is migrated to fresh openSUSE installation and that mail worked on old installation for all drupal sites (2x d7 and 1x d8). SELinux and AppArmor are currently not enabled.

Any help is appreciated...


texts: How to create a separate theme for a custom page?

texts: How to create a custom theme for a page? I want to create a template for my example/123 page.


texts:
Short Question :

is there a way convert all of one vocabulary taxonomy terms to one
content type nodes ? And switch all term refrences in the database to
entity references to the converted term/nodes?

Details :

A long time ago, I have made a website for music and i used the core
terms for local singers and performers now i want to use entity
reference for a better content control user interface.

the website has one content type "Audio File" The content type
fields are :

Audio file : file upload
Performer : term reference of vocab "Performers"

The taxonomy term fields are -Vocab : "Performers:

Performer Name : title field.
Performer Portrait : Image upload field

the site is running and there is already more than 150 singers and over 1000 audio files. So doing this manually is almost impossible.
I think i should use migrate module but i don't know how to use it and it seems very complicated !

Thanks :)


texts: What do the three checkboxes on the Interface translation import mean?

texts:
When importing a .po file at /admin/config/regional/translate/import

What do these three options mean?

Treat imported strings as custom translations
Overwrite non-customized translations
Overwrite existing customized translations


texts: Where do you put your template override files?

texts:
I am trying to get Drupal to recognize a template override that is a theme hook suggestion.
However, I don't know how to get Drupal 7 to recognize it.

Specifically, Drupal commerce allows for the override of a customer order using the template file
commerce-order--commerce-order--customer.tpl.php

I don't know where to put this.

I tried putting the file in my own theme directory, and clearing the cache. But it didn't recognize it.  Do I need to add something to the .info file of my theme?

I DID GET THIS TO WORK when I put the template in the main theme of the site, namely the omega_kickstart template directory. But this is not ideal for upgrading.

Finally, I tried making my theme a sub theme of omega_kickstart thinking it would override then, but that didn't work.


texts: Ajax pager of views does not work when using in quicktabs

texts:
I have 2 views that are using pagers since they display lists of articles. Each view is within a tab of a quicktab. The views are set to use AJAX.

Right now, I am able to move between the pages of the first view which is inside the first tab. The problem is when I move to the second tab and I try to use the pager to move through the pages. No matter what page I choose (in the second tab) the page redirects me to the first tab and the second page.

Also, I´ve set both pagers ID to a different number but the problem has remained the same.

This is where it points the second page of the second tab: localhost/drupal/live-healthier?page=1&js=true

To summarize, how can I use 2 views inside quicktabs with ajax pagers?

Thank you for your help !


texts: Aggregator channels do not update anymore

texts:
For a half year, I have run a website with all sorts of news channels displayed trough the core aggregator module on www.tri-portaal.be. Once in a while, I keep adding sources.

But recently my news channels do not update anymore. Even not after running CRON.
In the column, next update is stated 0sec.

Although I can update them manually, but that is a huge job to do every day.

I have searched the forums, but I can't seem to solve my problem.

Can somebody please help me or help how me diagnosing?
I am running drupal 7.43.


texts: Do I need to delete uploaded files if I only want to parse them

texts:
I'm building an upload form for uploading files which are only parsed, and don't need to stay on the server.

I have this code:

$validators = array('file_validate_extensions' => array('xml'));
$file = file_save_upload('file', $validators);

After which I parse the file.

As I understand it, it saves in tmp by default. Now if I don't do anything else but parse that file, will Drupal or the OS discard the temporary file automatically or do I need to do something else in my code to achieve that?


texts: Multiple file upload controls on same form via FAPI not possible?

texts:
My research seems to be indicating that only a single file control widget is possible per form when creating said form with the Forms API.

Is this true? Still?

I'm operating in D6, I don't want to use CCK because I want to keep my custom content type within a single DB table, but I do want to be able to upload multiple files - in separate form controls which lie in separate fieldsets from one another (logical context of what the file is for).

If one uses the CCK based upload options (such as those outlined here: How to upload multiple files at once?) as soon as multiple uploads are enabled, the content type's DB table gets fragmented by having the CCK upload control's data moved to its own DB table. I don't want that.

Is the only alternative to write some AJAX/AHAH logic handling this in the background, with the FAPI's file handling basically useless here?


texts: private message is not showing in messages page but with permission user/uid/messages show the messages list

texts:
I am using privatmsg module.

private message is not showing in messages page but with permission of 'showing read all messages', user/uid/messages show the messages list.

I have check the all permission its ok.

After some debugging, i found that in privatemsg.pages.inc file

$query = _privatemsg_assemble_query('list', $account, $argument);
does not return any result.

I will be very grateful getting any suggestion..

Please help


texts:
I created a taxonomy menu block based on a vocabulary I have. It didn't work how I wanted so I removed it. I have created a view (page) that has the same URL as one of the links in the taxonomy menu block, and that URL displays nothing (which is what happened when it corresponded to a link in the TMB), even though it shouldn't - its preview displays a list of content items. If I modify the view's URL the content displays, if I set it back to what I want it to be it displays nothing.

I've cleared Drupal's cache and even removed the TMB modules, but I still get the same thing.

Am I right to think it's likely to be related to the TMB that I got rid of? And can anyone suggest any steps to getting the content to display on the URL?

Thanks,

Toby


texts: Where is the field exclude checkbox in Content type > Manage display in Drupal 7

texts:
When editing a content type in Drupal 6, in "Display fields", there was a checkbox to "exclude" field (not just a dropdown for hidden).

Is there something like this for Drupal 7?


texts: How to upgrade to Drupals latest version via Composer?

texts:
Currently I have 8.6.13 installed.

composer update drupal/core --with-dependencies
Package "drupal/core" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update

When I tried to look in to composer.json we don't have drupal/core in

require.

https://www.drupal.org/docs/8/update/update-core-via-composer

How to upgrade to 8.7.0?

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.0].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.1].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.10].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.11].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.12].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.13].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.14].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.15].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.2].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.3].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.4].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.5].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.6].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.7].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.8].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.9].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.x-dev].
    - Can only install one of: egulias/email-validator[2.0.x-dev, 1.2.15].
    - drupal/core 8.7.0 requires egulias/email-validator ^2.0 -> satisfiable by egulias/email-validator[2.0.x-dev].
    - Installation request for drupal/core 8.7.0 -> satisfiable by drupal/core[8.7.0].
    - Installation request for egulias/email-validator ^1.2 -> satisfiable by egulias/email-validator[1.2.0, 1.2.1, 1.2.10, 1.2.11, 1.2.12, 1.2.13, 1.2.14, 1.2.15, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 1.2.x-dev].


texts:
I am trying to achieve a masonry-style blog post display using Views, which will look similar to this:
http://blog.iamcreative.me/wp-content/uploads/2012/10/MASONRY.jpg

I have an image in each result, but I want the Image Style to vary (e.g. 400x300, 400x400, 400x600) between the results. I would then use the Masonry Views module to achieve the masonry functionality.

Does anyone know how I can vary the image styles between the results so the post pictures will be of varying sizes?

Thanks in advance :)


texts:
Question: How can I import a Webform via the https://drupal.org/project/webform_share API?

What do I know/current state: The API shows a graphical UI to do it, but I'd need a way to do it via an exported function, if any (e.g. a function call like webform_share_import($formspec)).

Reason/scenario: Because I want to install some forms in the .install of a module.


texts: Type of drupal cache to be cleared on new hook implementation

texts: If I implement a new hook which cache type(like menu, css+js, etc) should I clear for the changes to take effect?