texts: Git workflow from dev to live when central repo is in local network

texts:
I use @dev - @stage - @live workflow, managed with drush rsync and drush aliases to update code, syncing db down from @live to @dev / @stage to have recent state.

Recently, I am trying to implement very simple git workflow into it, to secure revisioning of my code. I am not git power user, so I can bear only simple workflow for a good clean simple start (as a single dev I can be spared of situations where many devs are merging/resolving etc.)

There is my local machine (@dev), and staging machine (@stage) that are in my local environment (parties that need to review/QA changes have intranet access to staging machine);  @live machine is remote one, and code is drush rsynced to it.

Now, My Local @dev and @stage are not exposed to internet, (can push, but one cannot connect to them from outside)

I have choosen to create "central repo" on @stage machine. I followed strategy simmilar to this: http://toroid.org/ams/git-website-howto . There is bare repo and webroot. Then I cloned from that "central repo" to my @dev machine. When I commit and push to origin from @dev, there is post-receive hook that populates webroot of @stage server with new code state. It is then reviewed, QA-ed.

Now, I am thinking about strategies to propagate those changes on live. I was thinking to modifiy post-receive in such manner, that if "dev" branch is pushed from my local @dev to central repo, code is only propagated in webroot of @stage server. But if I push "master" branch, code would be propagated in webroot of @stage server, and drush rsync would be triggered to do syncing from @stage to @live. Remote @live site, in that case, does not need to have git installed.

I guess it could be done this way (I am testing this workflow already), but I am also considering would it be any gain if git repo would live on @live site too; and if answer is yes, how could I implement that safely (@live is already populated with stable state, but has no git(could have if needed)).

I cannot go to remote @live server and clone from central repo (that is on my @stage machine) because @stage is not exposed to internet (it could be in future, as new devs will probably join to work on project, and will need to clone from that, but for now, it needs to stay local). I am searching for way to push from central repo to @live on when master is updated. Maybe same post-receive that updates @stage after master is being pushed from @dev, can trigger pushing to @live (instad rsyncing to @live?). But how I could initialize repo on @live, bearing in mind central repo is not accessible over net ?

As a side question, is git friendly when I decide to change the whole proccess (for example, move my "central repo" on BitBucket or anoter remote site, more devs join in...?

I also noticed that git cloning does not keep any of interesting user:group privileges, and pushing code could propagate that "lost" file permissions, is this of some concern (I am not version controlling files and such, that is in .gitignore) ? Yet agian I could always run some commands to regain those privileges as in http://drupal.org/node/244924 but I am not sure if this is best practice.

I hope that some of this make sense and that someone with good nerves could give me advice or two. I know this is somewhat simmilar with (dis)advantages of staging dev->production using 'drush rsync' vs 'git'? but it differs in some details very important to me.


texts: Get file or image path as string from uid

texts:
I need to get the relative path to a file, in this case, what i need is:

/sites/default/files/pics/DSC00873_39.JPG

But all I seem to be able to get is the following:

$file = file_load($pic);
print $file->uri; // public://pics/DSC00873_39.JPG

Any ideas please?


texts: field_deleted_date_N and field_deleted_revision_N not removed on cron run or field_purge_batch()

texts:
I am running a site on D7. I noticed a no. of field_deleted_data_N and field_deleted_revision_N tables in my database. Through a lot of googling I found people saying that these tables will eventually be cleared on cron run. They also said you could run field_purge_batch().

However neither of there suggestions worked. Could somebody please help me solve this problem? Why are these fields never removed? Is there something wrong with my database? How can I remove them in a drupallish manner?

Thanks.


texts: Show item as local task but hide if argument is not provided

texts:
I have three tabs and third have wildcard in path. I added access callback for this menu item that checks if no argument then close access. The tab not shows afte that but ther is error "Notice: Undefined offset: 1 in _menu_translate()". So how correctly hhide this tab?

Access callback that I wrote:

/**
 * System log view access callback.
 */
function ebanq_custom_system_log_view_access($log_id) {
    return is_numeric($log_id) && user_access('access content');
}


texts:
Does anyone know how to send HTML email using the Rules module? This was a pretty common task in Drupal 7, and I think the rule was included with the Mime Mail module.
The Drupal 8 version of Mime Mail doesn't seems to integrate with the Rules module.


texts: How can you display document file sizes next to a media link button?

texts:
I'm trying to display the file size of a file next to a media link button on a page.

I have two content types with a media entity reference field in each. Each field is restricted to only pull from a file media type. What I was trying to do was create a twig variable using a field preprocess and pop that variable inside each of my field templates. However, my preprocess below doesn't seem to be displaying the file size as I want. What am I doing wrong?

function theme_preprocess_field(&$variables, $hook) {

  $pdf_fields = [
    'field_1',
    'field_2'
  ];

  if (in_array($element['#field_name'], $pdf_fields) && $element['#entity_type'] == 'node') {

    if ($variables['items'][0]) {

      $field_name = $element['#field_name'];

      $node = $element['#object'];
      // Get first referenced media id.
      $media_id = $node->$field_name->target_id;
      // Get file object.
      $file = \Drupal\file\Entity\File::load($media_id);
      if ($file) {
        // Get file size.
        $file_size = format_size($file->getSize());
        // Set file size variable.
        $variables['file_size'] = $file_size;
      }
    }
  }
}

Twig field template

{% for item in items %}
  Download Paper(PDF | {{ file_size }})
{% endfor %}


texts: How do I separate multiple values for "print render($content['field']);" with a comma?

texts:
So in my node template, I am using the following code:

print render($content['field_taxonomy']);

Sometimes there is only one result printed, and sometimes there are multiple results printed. How can I separate each result by a comma, but only if there are multiple results printed?

Thank you!


texts: How can I customize the Advanced forum layout as shown in image?

texts: Image in red are current default provided by the advanced drupal forum and image in blue marks what I want. So layout shown for A, B, C, in the blue lined image, that I want. In short I want to customize the layout of the original Advanced theme layout to wherever I want to place. Is it possible.


texts: CSS Not Displaying Correct Via .info File (ok on page.tpl)

texts:
Hello I have a strange situation that I just cannot get my head around and I hope someone can help.

If I add css directly in page.tpl as:

<style type="text/css">
  my css
</style>

Everything works as I expect. However, when I move the css to file called ross.css, and add  stylesheets[all][] = css/ross.css to my theme.info file the browser will parses the css code but the effect is not what I'm expecting. I don't know if I should post all the css in here as I don't think the code can be the problem if it displays as I expect when I insert it directly on the page.

PS: I'm using a bootrap-based theme.


texts: Why do I get Call to undefined function updatedb()

texts:
I am attempting to wrap my head around some of the advance features of drush.  i am using Drush User's Guide and it's example code and ran into this error [Fatal error: Call to undefined function updatedb() in /home/trakz/.drush/user_blocker.drush.inc on line 68]from the code below.

Line 68 is: [$query= updatedb('users')]

Can anyone tell me what is wrong?  I have checked the Drush guide and updatedb() is valid.  Googling around did not help.

drupal 6.28
drush 5.7

any assistance woudl be greatly appreciated.  Thank you.

/**
 * Callback implementation for user-blocker command
 */
function drush_user_blocker() {
  // Grab all languages given. If any.
  $languages = func_get_args();

  // See if we received a date from which we should filter
  $since = strtotime(drush_get_option('since', '2 years ago'));

  // Perform the update over the users table
  $query= updatedb('users')
  ->fields(array('status' => 0,))
  ->condition('uid', array(0, 1), 'NOT IN')
  ->condition('access', array(1, $since), 'BETWEEN');

  // Add the condition to filter by language
  if (count($languages)) {
    $query->condition('language', $languages, 'IN');
  }

  $total_blocked = $query->execute();
  drush_log(dt("Blocked !total_blocked users", array('!total_blocked' => $total_blocked)), 'success');
}


texts: Paragraphs item doesn't load on node/add

texts:
I have one content type were I cannot add Paragraph items.  I select the item, And I get the table header, but no paragraph loads, no error.

In logs I see:

  Location: .../system/ajax/

  Referrer: .../node/add/product/

  Message:

  Notice: Undefined index: #bundle in
  theme_paragraphs_field_multiple_value_form() (line 1170 of
  .../sites/all/modules/contrib/paragraphs/paragraphs.module).

Line 1170 is:

// Add the items as table rows.
foreach ($items as $key => $item) {
  $item['_weight']['#attributes']['class'] = array($order_class);
  $delta_element = drupal_render($item['_weight']);
  $cells = array(
    array('data' => '', 'class' => array('field-multiple-drag')),
    drupal_render($item),
    array('data' => $delta_element, 'class' => array('delta-order')),
  );
  $rows[] = array(
    'data' => $cells,
    'class' => array('draggable', drupal_html_class('paragraphs_item_type_' . $item['#bundle'])), // Line 1170
  );
}

This has worked, and I have other content types on which this field works.  I can not see any difference in the field or content types.

Has anyone run into this before?  I would love some direction on where to look for problems.


texts: Views: Is it possible to Group "exposed" filters in a  and add css to it?

texts: In Drupal 7, I have a Views which contained "content: ID", "Content: Type", "Content: Title", "Content: Organization", Conent: City", "Content: State" and "Date: Date(node)". They are all exposed. How can I group them into 3  groups(the group in rearrange only give the feature to add "and" or "or" group), so I can add CSS and make them as an expandable list. Is it possible?


texts: VotingApi function takes time to update the database

texts:
I have added a menu item that calls a function that calls votingapi_set_votes and delete votes. This function works locally fine but when uploaded to the hosting and when i call the function it takes like 5 minutes to update the database with the votingapi_set_votes function.

Menu_item's callback calls a function that contains votingapi_set_votes.
Locally: i call the menu item with the node id as parameter and the a vote is added to the node.
On Hosting: When i call the menu_item i need to wait five minutes or so to see the node vote updated.


texts: Looking for best way to approach user profiles

texts:
I'm looking for the best way to approach user profiles, I'll tell you what I want to achieve and maybe someone can give me some advice - There are a few things I'd like to do but not sure where to start, so here I go...

First I'd like 2 different user types, personal and business. When registering the user chooses which type of account they want and fills out the relevant form (personal and business will have different fields available to them, for example a business account will display a vat number where as a personal will not)

Then when a user creates a node I'd like fields from their profile to be displayed on their node, for example their name, location, picture and a link to their profile to name a few. (I would like this so people can search content based on users location for example)

I think these are the 2 main functions I'd like to get out of user profiles - what would be the best way to tackle this? I have seen a couple of modules - 1 being Profiles2 but I'm looking for an all in one solution if possible because I seem to be having trouble using multi modules for different tasks regarding this unless someone has a good guide on how to do this?

Thanks

EDIT:

Sorry to reply to my own post, but I have been looking more at Profiles2 and think this may be the best approach, I have created 2 'Rolls' "Personal" & "Business", Now I'm thinking I will create 2 'Profile' types, 1 for each, and a personal roll can only use personal profile fields and business roll for business profile. I think I can do this but its all in my head at the moment, but how could I go about giving the user which type of account they want on registration? (Without having 2 separate registration pages) I can see a way to create 1 page for each type of registration but is there a way that the user can check a radio button for which type of account they want during registration, they will then be displayed with the relevant profile and wont be able to see the other profile type - Do you know what I mean? So just to summarize the user clicks register -> they choose a username and password and then they check a box for which account type they want, (in my case business or personal) once they click submit they have to fill out the profile they chose after their account is activated. Is this possible? Thanks


texts: How to insert data to webform via HTTP/Drupal REST module?

texts:
I have hooked up a simple webform and now I need to insert data via HTTP/Drupal REST module ?

Is is possible to insert this way, else should I insert directly to DB ?


texts: How to programmatically reset user password

texts:
I'm trying to create a custom module for resetting the user's password.

In the following block of code I'm attempting to get the password in hash form:

$pass='User123@';

$autoloader =require_once(\Drupal::service('file_system')->realpath('autoload.php'));
//echo $autoloader; exit;
$request = Request::createFromGlobals();
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod', FALSE);
$kernel->boot();
$password_hasher = $kernel->getContainer()->get('password');
$newhash =  $password_hasher->hash($pass);

//echo  $newhash ; exit;

This is my db update code:

 $updatepass = \Drupal::database()->update('users_field_data')
      ->fields(array(
        'pass' => $newhash,
      ))
      ->condition('name', "$id",'=')
      ->execute();

Please help me understand what mistake I've made.


texts: Arranging related nodes in doubly linked list

texts:
I've an article and related stories. So I want users to navigate between the stories left or right or back to parent(the article).

Book module does it but when having 100's of books(articles) it could be cumbersome.

Is there any module in which I can create queues/groups which can be browsed much like book module based node pages? Nodequeue does not generate prev/next links and I don't think it provides what I want.

Any suggestions?


texts: Content Types with field "clusters". Possible or is there a different solution?

texts:
My dilemma is this. At the moment I have a content type called "equipment" that I want to have a taxonomy term that will give a type of equipment, based on the selected type I want a new "cluster" of fields and/or taxonomy terms to pop up.

There is likely a different/better way of organizing the data.  Creating a new content type for each type of equipment doesn't seem very elegant, especially if I want to create a view for all of the equipment.

Any leads on where I can find a solution to this? My brain has problems with decorator patterns in SQL as well.


texts: Migrated D8 site breaks when cache_discovery is truncated

texts:
I was developing a site for a migration on Acquia's free tier, but it turned out there wasn't enough space for all of the files. Since I can no longer use local development/acquia for development, I decided to migrate it all over to another host that I use.

Did my normal process of installing a clean site on the new server, and then copying the modules, themes, and file folders from the old dev site to the new dev site, and then importing the full database dump from the old database into the new database.

Boom, site is up and running. I go to clear the caches on the new dev site to finalize the migration and am met with the angry error "The mysite.com page isn’t working. mysite.com is currently unable to handle this request. HTTP ERROR 500".

After re-importing a few times and clearing the cache tables one at a time, I've learned that the cache_discovery table in particular is the culprit. Clearing all of the other cache tables works fine, but when I clear this one the site throws that error.

Anybody know what might be happening here? I never encountered anything like this in D7 and this is my first D8 build, so I'm not sure how to proceed.


texts: How can I find the name of the field store in the DB?

texts:
I have a content type for which I have created my own img using cck like this:

How can I find the name of the table that stores the img field?


texts: How to filter a node view on a paragraph field

texts:
I have a content type "Lunch" containing a paragraph type field named "Ingredients". This is a multiple values field which store a prapgraph type named "Ingedients" => Taxonomy term + Quantity
LUNCH
|- Ingredient1 (Term1 reference + quantity1)
|- Ingredient2 (Term2 reference + quantity2)
I have created a view displaying the tiles of my 3 encoded lunches. Until here, everything is fine.
Now, I would like to add an exposed filter to get all lunches congtaining a specific ingredient. For this I have added a relationship on the ingredient field:
Paragraph referenced from field_ingredients

Doing this is fine, because now, I can add an exposed filter using this relationship
AND
Doing this is bad, because as soon as I have added this relationship the number of rows in my view has been multiplcated by the number of ingredients... even if I check distinct in the SQL parameters
Any hint to solve this issue?
EDIT TO ADD: I could solve this by removing the duplicates in hook_views_pre_render but is it really the best thing to do?
REAL SOLUTION BASED ON prkos ANSWER:
1-In the advance>Other section I have enabled the aggregation
2-I have added my Ingredient field in the field section (exclude from display)
=>This is the taxonomy reference field of my Paragraphs field named "Ingedients". In other words, I have a paragraph type with 2 fields  (Ingredient and quantity) and I selected "Ingredient". Do not select the paragraph itself.
3-In the aggregation parameter of this added field, I selected  ID of the entity


texts: How to create a custom Webform handler to submit to a SOAP API

texts:
I have a Webform that when submitted needs to be posted to a SOAP web service. I have search for a bit of direction but I can't seem to find anything about SOAP and Drupal 8/Webform. Can anyone point me in the right direction to create a custom handler to submit to SOAP.

I'm using Drupal 8.6.16 and Webform 8.x-5.2


texts: Programmatically change view path without views_alter

texts:
I have a PHP script in which I want to set the path to a view.
For example on site1 I want the news to be at /news/index.html and on site2 I want the news to be at /blog/news/page/1.
The sites are sharing the modules folder so I cannot do this from the modules files. So I have a script in which I'm doing my initial setup for each website. Everything works perfect but the view path is not saved.

1. $view = views_get_view('news');
2. $view->display['page']->handler->options['options']['path'] = $my_path;
3. $view->save();

I also tried to use $view->override_path instead of line 2 but it's still not working.


texts: Modify Drupal pagination to restrict shown page numbers on Drupal 8

texts:
On Drupal 8:

I have a pagination for list of articles within a Drupal site  e.g.:

<<first <previous ... 3 4 5 6 7 8 9 10 11 ... next> last>>

So at the moment there are always nine page links shown. Basically I want to find out how to modify this so there are (for example) only five links and the text for labels for the controls in the pager like this:

<< < ... 6 7 8 9 10 ... > >>

I wrote this code with not result:

/**
 * Implements template_preprocess_pager().
 */
function MYTHEME_preprocess_pager(&$variables) {
  $variables['quantity'] = 5;
  $variables['tags'] = ["«", "‹", "›", "»"];
}


texts: Change error message generated by webform for duplicate email submission

texts:
I have a webform which takes a name and an email, the email field is set to not accept duplicates.

I have done this by choosing unique in the field settings (which is next to the required checkbox).

The error message it shows when a duplicate email is attempted is

'The value email has already been submitted once for the Email field. You may have already submitted this form, or you need to use a different value.'

How can I change this completely?


texts: Including template footer.tpl.php within another template page.tpl.php

texts:
I am looking for simple way to include footer.tpl.php that is just html block into another template like page.tpl.php. In Grails/Groovy that is as simple as

<g:render template="side_menu"/>

Is there a same simple way(preferred no use any panels, custom modules, etc) in Drupal? Thank You


texts: How to use an omega template with hook_theme

texts:
I'm using page callback function to display a page. How would I change this to use an omega template? I've tried adding a vis.tpl.php to the omega templates function but to no avail. I don't understand how to declare a omega template for use with a particular page.

<?php

function vis_menu() {

  $items['images'] = array(
    'title' => 'Images',
    'page callback' => 'image_page',
    'access callback' => TRUE,
  );
  return $items;
}

function image_page() {
  return 'hello';
}

Any help would be much appreciated.


texts: Is there a setting to turn off block caching per block / block type in the admin UI?

texts:
I want to display the date in a block and make sure that it is always up-to-date (i.e. not storing an old cached value).

Currently the date does not change, unless the cache is cleared ( via admin/config/development/performance or drush cr )

It would appear that Drupal 8 does have a setting in the web admin UI for block caching, according to the question in: Has the Block Cache Settings from Drupal 8 been back-ported to Drupal 7?

Screenshot of the Drupal 8 block cache settings from that question:

However, the author of that question did not provide the specific URL path to this web UI admin settings (And I have asked them in the comments, linking to this question)

Can you advise where the block cache settings are in Drupal 8 and if it can turn off the cache for a block, please?

In my searching so far I have come across programmatic examples for switching off the cache.

I'm a developer and in the past for Drupal 8 I have done this programmatically for a custom block implemented in code in a custom module so I can but this approach would seem to be unnecessary extra work for turning off the cache for a particular block built in the UI (rather than in code). I would not like to have to add this for each particular block created in the UI.

Programmatic examples are:

Drupal 8 block cache (very similar to my problem)
Custom Block Can't Invalid the Cache
Drupal 8 block cacheing
Drupal 8: How do I invalidate cache for a block for anonymous users on a schedule?
How to prevent a block from being cached?

Further information what am doing

I have implemented a custom block using today's date as a token via the blocks UI: admin/structure/block/block-content/types and created a block type from this using admin/structure/block/block-content and then placing it in the block structure using admin/structure/block

I am storing this as part of the config (yaml/yml) made possible using simple_block module which adds capability to store block config in the configuration system (so that I can import and export config as yaml drush cex / drush cim. I am hoping that this turning off cache setting for a block cab be stored as config as well.

Thanks for reading and thanks your input.


texts: Can I create custom Entity Metadata Wrapper implementation for my custom entity type?

texts:
Basic usage of EMW is like:

$wrapper = entity_metadata_wrapper($entity, 'entity_type');
$value = $wrapper->field_name->value();

Can I create EMW subclass for usage like this?:

$wrapper = entity_metadata_wrapper($entity, 'entity_type');
$value = $wrapper->getFieldName();
//similar for setter


texts:
I have a content type for publications that has a Related Content field for authors (which is another content type). I would like to create a view with exposed filters, where site visitors could browse or search publications by authors.

I created a page view that displays all publications and tried adding a filter [Content: Related content (exposed)]. It works, however I need to enter author's ID rather than name. Is there any way to make the search by related content title rather than ID?

Thank you in advance!


texts: How can I add a Pathauto pattern for a content type depending on a reference field?

texts:
On my site I have a content type 'Article' that has a reference field to a taxonomy vocabulary 'Type of Article' containing terms like 'Blog', 'News', etc.
Now I would like to have Pathauto form a different URL for each type of Article. E.g. /blog/article-title, /news/article-title, etc. Is it possible to set a pathauto pattern depending on the settings of that reference field?
Earlier I used different content types, with which it was no problem to get a different Pathauto pattern for each. But as the fields in the content types were the same I would like to solve it like this.


texts: Programmatically creating multivalue field with a button of add another

texts:
In the field ui, we can create a textfield with unlimited values. Which has button of add another, which when clicked added another field with a remove button.

I want the same functionality in my custom form. How will I create a textfield with unlimited values?


texts: How to create a custom menu in Drupal 7?

texts:
I need to create custom menu in Drupal 7. I don't need to add links on Main menu, but instead I need to create new menu with new menu links.

How can I do so?


texts: Share Unpublished nodes through a link that needs a user authentication

texts:
I am trying to share unpublished node through its URL to a specific role.

What I am trying is that when that user (with the specific role) opens that link, he'd have to login to open the URL.

Is it possible?

Thanks


texts: Display an image in menu generated from taxonomy terms

texts:
I am using Drupal 7 with Taxonomy and Taxonomy Field Menu to generate a menu based on taxonomy terms (Categories) - including node links (the terms themselves are not linked, just the nodes, in case this is important somehow). I am using this menu in Panels in two panes.

I need to display an image alongside the nodelinks (just one per taxonomy term) and this image needs to be easily replaceable from the backend. The menu is supposed to look like this:

- Home
- Taxonomy Term 1
    - Node
    - Node
    - Node
    [Image for Term 1]
- Taxonomy Term 2
    - Node
    - Node
    - Node
    [Image for Term 2]
- Taxonomy Term 3
    - Node
    - Node
    - Node
    [Image for Term 3]

The views module is not really an option, as I don't have enough time to work through and understand 30 chapters of "Taming the Beast". It may pay off in the long run, but there simply isn't enough time for views at the moment. Any alternative approaches are welcome.


texts:
I'm building my first custom REST resources.  I have a custom entity and returning specific fields from it.  However, it's very important that if a specific field changes (a status field) that it is reflected in the response.

What I'm seeing is that I have to clear the cache every time I update the entity.  How do I make sure the response is up-to-date?

I have tried using both \Drupal::entityQuery and \Drupal::entityTypeManager()->getStorage()... but both require a cache clear.  Maybe I'm loading the entity incorrectly?


texts: How do I re-attach AJAX behaviours to a managed_file field?

texts:
I currently have a form which is generated by the FAPI via an jQuery AJAX call, and then is inserted into the DOM.

This works fine, but the problem is that managed_file field within the newly generated form have lost all their AJAX behaviours. I've tried a couple of things to try get Drupal to reattach the behaviours after the form is generated but I'm having no luck.

Here's my code for retrieving and inserting the new form into the DOM:

$.ajax({
type: 'POST',
url: '/example-get-form',
dataType: 'json',
data: 'get=1',
success: function(response){

  //insert new form into DOM
  var newForm = response.data.form;
  $('.profile-form.edit').append(newForm);
  Drupal.attachBehaviors();
}
});

As you can see from the frontend code, we retrieve the rendered form HTML via AJAX and then insert it into our container div with the selector ".profile-form.edit". The form is rendered and inserted into the DOM correctly, but the problem is that the dyanmic form's managed_file field can either be empty or contain an image, so both the "Upload" and "Remove" buttons needs to have their AJAX behaviours reattached.

Here's the code for generating the form via the callback URL called from my jQuery script:

//generate form and send via JSON
$response['data']['form'] = drupal_get_form('mymodule_example_form');
$response['data']['form'] = render($response['data']['form']);

return drupal_json_output($response);
drupal_exit();

Any help to put me on the right track would be greatly appreciated!


texts: How Can I send sms confirmation when user creates a new account in my website?

texts:
Can I send sms confirmation when user creates a new account in my website?

How Can I? what modules I have to set for this?


texts: How do I programatically create and display a one-off view?

texts:
I am programmatically generating views based on an entity with varying fields  and saving them with $view->save().  Just to be clear, I have to do this because my entities have x-amount of fields, and the view needs to display all the fields.

I am thinking that creating all these views in the database might not be a good long term plan, especially when I go into the Views UI, and see a billion views there.

Can I create a one-off view (e.g. typical Views export code producing a block), and print its block to a page without saving it?


texts: How can I store the user agent string and referrer for Webform 4.x submissions?

texts:
In Webform 3.x, I have a "Give me feedback" webform that I embed in various places throughout my site using Panels.  This form contains two hidden fields:

Referer / Default value: %server[HTTP_REFERER]

User agent / Default value: %server[HTTP_USER_AGENT]

This is extremely helpful because I can get the details of users' machines without having to ask them as well as get the page the user came from (because the webform is embedded on a number of pages throughout my site with Panels).  However, %server\[\] tokens apparently no longer work in Webform 4.x:

  Most tokens will be upgraded for you, however some tokens do not have
  equivalents and no longer work. These include %post, %request,
  %cookie, and %session. The %get token (which maps to PHP's $_GET
  variable) has the equivalent token [current-page:query:key].

Is there an alternate way to somehow include the user agent string and referer in a 4.x webform?


texts: Custom content type with a gallery and its "subgalleries" (or categorized gallery) in D7

texts:
I have a content type with some custom fields, and I would like to have a gallery in it, with the images grouped into predefined "categories" - like a "subgallery".

For example, I have a "building" content type, and I would like to categorize the photos of it depending on of which part of the building (house) these photos were made or if they are simply archive photos, etc.: you can think of categories e.g. like "Inside", "Outside", "Archive", "Misc."

I made a drawing to make it clearer:

What would be the best way to solve this problem?

Thanks for any kind of ideas!
Ask if anything is unclear.

In the meantime, I found a Media Gallery issue related to the topic:
New feature: Gallery containers (other related issues: Hierarchical galleries, Categorizing galleries)


texts: Use value from buildForm() in submitForm()

texts: My buildForm() method queries the database and returns data which is used to calculate default values for the form. How can I use these values in submitForm() without querying the database again?


texts: Pre-populate field in content from user profile

texts:
I'm trying to pre-populate a field in a new piece of content with a country field from a users profile. These are two different Drupal fields, but they are both using the location module so country codes should easily transferred between the two.

I have managed to verify the data from $field_country_you_co_ordinate_fo['und'][0]['country']), this prints the country code 'gb' as expected.

I can't pull the value into $form['field_location']. Tried several different chains of array keys based on the previous ticket linked at the bottom. I'm clearly misunderstanding the combinations of keys needed to pull from one variable to another, so any help would be greatly appreciated.

Thanks in advance

function perma_boot_form_organisation_node_form_alter(&$form, &$form_state, $form_id) {
  // Only run against newly created node

  if (empty($form['nid']['#value']) && (!isset($form['#node']->op))) {
    global $user;
    $user_fields = user_load($user->uid);

    if (isset($user_fields->field_country_you_co_ordinate_fo['und'][0]['country'])) {
        //print_r ($user_fields->field_country_you_co_ordinate_fo['und'][0]['country']);
        $form['field_location']['und'][0]['country'] = $user_fields->field_country_you_co_ordinate_fo['und'][0]['country'];
    }
  }
}

Have been working from the previous example:
How to pre-populate fields on a node creation form based on fields from Profile2 module?


texts:
With respect to the question, can anyone suggest a remedy for the same.
How can I create a field for currency(with selecting currency and text field to enter the amount) considering the fact that there are multiple currencies.

I have tried adding prefix but it can input only a single value(for example $ or pound etc). I have also tried the currency module but it gives a single page with multiple currencies.


texts:
I am looking to modify the default output of Drupal 8 of links in a certain situation, the language switcher. Ideally I want to be able to do that in a twig template and not have to produce a massive php file that overwwrites that whole link generation system and add a BIG if for the cases I need to overwrite.

I think the output layout should be controllable in the twig template similar to this answer (this answer outputs the same url for every languages)

I am using bootstrap as a base theme so i'd like to use the bootstrap markup for my links (btn btn-primary, dropdown)

Here is my code I am trying to make links--language-block.html.twig

{%- if links|length == 2 -%}
    {# show only alternate language button #}
    {%- for key, item in links -%}
        {%- if not item.attributes['#options']['set_active_class'] -%} {# <--- this is always true!? #}
            {{ item.link['#title'] }} {# #url is always the same what ever the language it is pointing to! #}
        {%- endif -%}
    {%- endfor -%}
{%- elseif links|length > 2  -%}
    {# show selected language in button and other languages in drop down #}
    <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{{ selectedLanguage }}</button>

        {% for key, item in links %}
            {%- if not item.attributes['#options']['set_active_class'] -%} {# <--- this is always true!? #}

{{ item.link['#title'] }}

            {% endif %}
        {% endfor %}

{%- endif -%}

Anyone has an idea on how to do this?


texts: Changing decimal field scale and precision using database

texts:
I'm using a custom decimal field in a custom product type in Drupal commerce. It has a precision of 10 and a scale of 2 (2 digits to the right of the decimal place).

I have a client with a large number of products that use this field, but their specification has now changed to require a decimal to 3dp.

By default Drupal "locks" the field to avoid data loss:

  Because the field already has data, some settings can no longer be
  changed.

I took to editing the database, and it seems to have worked fine. I did three things:

Changed the structure type of field_THIS_FIELD_value field in the drupal_field_data_THIS_FIELD table from decimal(10,2) to decimal(11,3)
Repeated the same for the field revision table
I downloaded the BLOB from table 'drupal_field_config' for field_THIS_FIELD and altered {s:9:"precision";s:2:"10";s:5:"scale";s:1:"2" to {s:9:"precision";s:2:"11";s:5:"scale";s:1:"3"

I cleared cache and existing data now has an extra 0 after the decimal place, and when I alter the data it stores it to 3 decimal places.

So it seems to work fine. But am I missing anything? Is there anywhere else where field data is changed that I might need to change?

Does the system integrity remain intact? I think I've done what's necessary but don't want to inadvertently break something else or cause any weakness in the system.


texts: How do I record hook_menu() access statistics

texts: I have a standard menu hook function in a custom module which links to example.com/foo/bar, how do I record access statistics for this page?


texts: Is it possible to free tag user accounts in Drupal 6? For example, a user with appropriate permissions would be able to add tags created on the fly to any user account. If I could limit which user roles could be tagged, that would be a bonus.


texts: Adding an extra class to the last element of the navigation/tree menu

texts:
For one of my projects, I have to create a tree menu, with parents and children, that would be used to navigate through the website. The parents are collapsible. Below is the twig file that I am using to generate the menu:

{% macro menu_links(menu_tree, route_tid, current_depth, max_depth, collapsible) %}
{% import _self as macros %}
{% for item in menu_tree %}
  {%
    set liClass = [
      item.subitem and current_depth < max_depth ? 'menu-item menu-item--expanded block-taxonomymenu__menu-item block-taxonomymenu__menu-item--expanded' : 'menu-item block-taxonomymenu__menu-item',
      route_tid == item.tid ? 'menu-item--active block-taxonomymenu__menu-item--active' : ''
    ]
  %}

    {% if item.image %}

    {% endif %}

      {{ item.name }}{% if item.show_count == true %} [{{ item.nodes|length }}]{% endif %}

    {% if item.subitem and current_depth < max_depth %}
      {% if item.interactive_parent %}

      {% endif %}
      {% if collapsible == TRUE %}

      {% else %}

      {% endif %}
        {{ macros.menu_links(item.subitem, route_tid, current_depth + 1, max_depth, collapsible) }}

    {% endif %}

{% endfor %}

{% endmacro %}

I wanted to know if it was possible to add an extra class to the last li class of the tree menu? I have actually tried to add current_depth == max_depth ? 'item--last': '' in the setliClass and {% if
     current_depth == max_depth %}item--last{% endif %}" in the li class="{{ liClass|join(' ') }}" part, but this is not working.


texts: Displaying and selecting data from a database in a module

texts:
I have a database table (gpx_api) with the following fields:

runID   userID  score   distance    pace    speed   gpx_path    missionID   startTime   duration

I want to display all of these fields from within a module.

I have searched a lot on stack and I got until here:

   $query = db_select('gpx_api', 'run')
     ->fields('run')
     ->condition('runID', $firstparameter, '=')
     ->execute()
     ->fetchAssoc();

Do I only select the row where runID = $firstparameter like this?

This should only return one result. Now how can I display the fields one by one?

$query->distance

will not work.

I also tried

foreach($query as $result2){
 $result .="DISTANCE";
$result .= $result2->distance;
  }

This strangely enough gave a lot of results and errors.

I am sure there is a very simple way, but I am not familiar with the drupal API.

--Update

a var_dump of query gives me:

array(10) { ["runID"]=> string(1) "2" ["userID"]=> string(1) "1" ["score"]=> string(2) "10" ["distance"]=> string(3) "200" ["pace"]=> string(1) "7" ["speed"]=> string(1) "8" ["gpx_path"]=> string(0) "" ["missionID"]=> NULL ["startTime"]=> NULL ["duration"]=> NULL }

so it is just about displaying the array. Shouldn't $query->distance  work then? Yet if I try it, I get this error:

Notice: Trying to get property of non-object in epicrun_mymenu_page_callback() (line 62 of /home/suneesto/public_html/addons/epicrunapp.com/sites/all/modules/epicrun/epicrun.module).


texts: Responsive image folder creation inconsistencies

texts:
Just implementing responsive images and find that I have one content type (slider) that the folder structure does not get created as expected in the styles folder.
Output is:
slider_mobile1
| ---public
| ---core
| ---modules
| ---image
| sample.png
Now on all the other content types there are no issues:
mobile_x1_banner
| ---public
| ---banner
| abc1.jpg
| abc2.jpg
| abc3.jpg
Double checked settings display with responsive image and style selected, run cron, flush cache, and run update, recreated image styles with no success. Would appreciate any pointers before I give up on the Responsive Images.
Thanks much.


texts: How do I target different types of anonymous user after a gateway page?

texts:
So there are a whole bunch of useful tools in Drupal for changing how a website looks depending on a number of factors, including which page you're on, what roles you have, whether you're logged in or not:

Page Manager (part of Chaos Tools in Drupal 7), and the contexts provided within (found a freaking awesome tutorial on this stuff here)
Context
Domain Access and various others like it
Organic Groups

But I can't seem to figure out how to make the following use case work:

Anonymous user visits site

a. If user has never been to the site before (on this browser/computer), ask whether they are A or B

b. If user has been to the site before, figure out whether they are A or B (should be easy enough with cookies/session variables)
Change how site looks depending on whether user is A or B

It's really easy once they log in, but how do I tell anonymous users apart?

I tried installing ctools cookie context and ctools session context in the hope that I could use these to provide the necessary hooks for visibility settings in page manager... but visibility settings don't seem to use contexts!

Surely somebody has tried to do this before me?  Maybe I am googling the wrong words but I've been at this for several days without a clear idea yet.


texts: How do I display an image using the Dynamic Background module?

texts:
I have been struggling to get the Dynamic Background module working for users' profiles. The profiles are displayed in a panel.

I enabled the Panel and User sub-module and after hours of trial and error I found a CSS combination that seems to work: #page #main-wrapper.

So the image displays as a background. But if I go to /user/[uid]/backgrounds to enable a background image for that user, it works but the image displays for ALL users, even when the other users have not enabled a background image.

I am at a loss because I thought that everything after user/[uid] only affected that user.

Any idea what I am doing wrong?


texts: how access $content array inside a block php?

texts:
I have created a block and the format of it's content is PHP CODE.

this block is available only full page of node type article.

now in my block , I want to access $content or $page array.

I used global operation such as

global $content;
dpm ($content);

or

global $page;
dpm($page);

But both of these blocks return no result.

Please guide me.

Thanks a lot.


texts: How to add dependency to a custom module with drupal-composer?

texts:
I have a problem with dependencies in my custom module.

I'm using drupal-composer and I'm able to install my own module with the composer.json. My module comes from custom Git repository.

At this moment, though, I'm unaware of any working way to get my custom modules dependencies installed at all. I can add them one by one to the composer.json, though they do not appear into right namespaces after that, but let's just disregard that because I would really like to be able to specify them into my custom module and get them installed automatically. This is because I will be having multiple modules with multiple dependencies. Also, some of these dependencies will be from my own repositories, but that should not make any difference. And to be specific, at this point I'm trying to add a custom git repository containing some PHP source files that I need for the services exposed from my modules.

I have also tried installing modules from Drupal packagist and their dependencies are all nicely downloaded.

So is there any way to specify these dependencies into my own module and how to get them working? I have added them to my modules composer.json, but that does not seem to have any effect. They also need to be there when I run my PHPUnit tests.

Also I'm aware of the composer-manager plugin for Drush, but at this point, (due to other requirements) it is not an option.


texts: How to remove link from rendered node title in view?

texts:
I have added a field to the view displaying a Taxonomy Term: Rendered Taxonomy Term

http://freelance-graphic-designer.us/barmaiddev2/product-category/commercial-juicers

I want to remove the link from the title Commercial Juicers

After reading other posts, I have found the template file node.tpl.php and copied it to the template folder of my theme; and renamed it to node--taxonomy-term.tpl.php

Then removed the link, and changed the following code from:

<h2<?php print $title_attributes; ?>><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?>

To this:

<?php print $title; ?>

I don't know PHP, so this was a guess. It did not work.


texts: How to uninstall one site of a multi-site?

texts:
Things are bit messed up in one of my sites, partly because of modules that did not clean up after themselves when I disabled them and partly because I tried to clean up for them, which of course, only partially worked.

So I want to remove this site and start it over again with a fresh install. But I don't see anything on how to uninstall or remove a site.

(This is a development environment, of course!)

Thanks for your help.


texts: How do I include a jQuery in the body of a content type?

texts:
I try to include a jQuery in the body of a content type, as shown in the image below:

The purpose of this jQuery is to hide a div with id="test", so that the text aaaaaaaaaaaaaaaaaaaa in it is not shown. The jQuery was added to the content (saved in it), but yet I still can see the aaaaaaaaaaaaaaaaaaaa and my js did not run.

I added scripts[] = js/test.js to my .info file. I then put test.js inside the mytheme/js folder. I cleared all caches and still nothing happens. I also installed jQuery, changed to version 1.10, and still no luck.

Seems like Drupal JQuery.js file is not loaded, so how can I get it loaded? Do I also need to add jquery.min.js in the .info file and the js/ folder?

UPDATE:

(function($) {

$('#wrap').hide();

})(jQuery);

When I put the above code in a block, it works. If I put in the test.js file, it doesn't work.

If I put an id or a div that is not part of my page.tpl, it doesn't work even on a block.

This is so weird.

Update #2 (re-edited)

Turns out the actual reason it didn't work when using the .info and .js file is that the .js file needs a document ready function

(function($) {
$(document).ready(function(){
$('#test').hide();
});
})(jQuery);

Thanks to all that tried to help.


texts:
I am trying to make a Rule where after the user logs in they are redirected to the front page except when they are setting their first time password or resetting their password
To do it I want to use a Rule that acts on User Logged In, with a condition that checks if the url they are on has edit in the name, and if it doesn't then redirect them to the front page.
My issue is that when I try to use the Path Contains Text condition it never triggers, and if I try to print the url in a message as the action it is always empty.
What am I doing wrong? What do I need to do to get the results I want?


texts: Field Slideshow Different Trasitions Effects on Different Pages

texts:
Is there a way we can define different transition effects on different pages for field slide show.

-- ok here is an edit

field_slideshow calls a jquey file field_slideshow.js in the header of the page. It has this code which I think controls the animation effects.

fx: settings.fx

Is it possible to override this line only on particular page to define different animation effect.

I am thinking to insert some override code before closing body through JS Injector


texts: Taxonomy Access Control Change Default Behavior

texts:
From Taxonomy Access Control Documentation

  Users with multiple user roles: Allow/Ignore/Deny options are
  interpreted only within one user role. When a user belongs to multiple
  user roles, then the user gets access if any of his/her user roles
  have the access granted.
  In this case, permissions for the given user
  are calculated so that the permissions of ALL of his user roles are
  "OR-ed" together, which means that Allow in one role will take
  precedence over Deny in the other. This is different from how node
  access permissions (for multi-category nodes) are handled within one
  user role, as noted above.

This is a default behavior of the TAC. But is there a way to change this behavior so that the it is AND-ed instead of OR-ed or in other words a Deny in any of the roles would deny access to the content even if the other role has Allow permission.

The use case is as follows. Let us Assume there are Two Taxonomy called Grade and Subject. And all the contents are tagged with with both the terms.

A student logged in with a role of Grade 1 and Science should only be able to see the contents tagged with both Grade 1 and Science

The way to go about it should ideally be set allow permission to the Grade 1 role to access all with the grade 1 Term and deny for rest of the roles in the grade category such as grade 2 grade 3 etc.

Similarly Set allow permission for Science and Deny for the rest of the subjects.

With the current setup if you give the role Grade 1 and Science. the student would be able to see all the subjects in Grade 1 and all Grades in science.

Is there a way to accomplish this.


texts: referencing/linking to an entityform and passing nid/other field information through the URL

texts:
Thanks in advance for any help with this - I feel a bit like I'm down a rabbit hole.  I know there must be several ways to do this, but I'm running into some obstacles.

I'm trying to set up an event registration, but for various reasons, Entity Registration, Node Registration, and Signup don't work for what I'm looking for.  I have a content type "event," and I'd like to link to an entityform to allow anonymous users (not registered on the site) to sign up for events.  Ideally, information about the event would pass through the url or through using references to the entityform and populate the Event field and the Event Type field.

I tried using node reference URL and entity reference prepopulate, but ran into some major issues trying to reference/link to the actual entityform, as opposed to creating new content through a link.

I'm using entityform because of views integration, because I don't want anon folks to have to create new content (i.e. have a content type "registration" and have them create new ones to sign up), and also because I'm validating their email against an email collected through another registration form (volunteer registration, and I can't do that with the anon_email field in Entity Registrations.

One caveat - I'm building this site for a tiny non-profit, without the resources to do any real development in the future, so I'm trying to find a solution using features that already exist (or mostly exist).

Thanks so much for any suggestions/pointers! I've been stuck on this for a while now, and I know I'm probably just missing something big.

EDIT:

Found an inelegant solution by passing info through the url.   entityformurl/?event=[node:nid] did the trick. (Where my field name is event). If there is a better way to do this, I'd love to hear it.


texts: Problem with creating own module Block with an SQL query

texts:
I’m trying to create a custom module that implements a block to display something I haven’t been able to do with the Views 2 module.
I’ve tried to look at some guides and tutorials, but I haven’t got any result yet.

I can print out the first SELECT attribute in the first row. The first row make sense since I don’t loop through it but still I’m confused on how to do the rest.

function sn_most_contributed_block($op='list', $delta=0) {
  if ($op == "list") {
    // Generate listing of blocks from this module, for the admin/block page
    $block = array();
    $block[0]["info"] = t('Most Contribution this week (custom module');
    return $block;
  }
  elseif ($op == 'view') {
    $mce = db_result(
      db_query("SELECT node.uid, COUNT(nid), users.picture AS users_picture, users.uid AS users_uid, users.name AS users_name, users.mail AS users_mail FROM node node INNER JOIN users users ON node.uid = users.uid WHERE (node.type IN ('leads',  'qa',  'qa_comments',  'til_salg',  'tips_tricks')) AND node.created >= UNIX_TIMESTAMP( CURDATE( ) - INTERVAL 1 WEEK ) AND node.created <= UNIX_TIMESTAMP( CURDATE( ) + INTERVAL 1 DAY ) GROUP BY uid ORDER BY COUNT(nid) DESC LIMIT 0 , 5")
    );

    $block_content .= "Most contributed members are: " . $mce';
    $block_content .= "
In here should be the user image
";
    $block_content .= "
In here should be the username
";

    if ($block_content == '') {
      $block['subject'] = 'contribution test';
      $block['content'] = 'yay';
      return $block;
    }
    else {
      // set up the block
      $block = array();
      $block['subject'] = 'Most contribution this week';
      $block['content'] = $block_content;
      return $block;
    }
  }
}

I’ve tested my query in the database environment for my Drupal site and it works and print everything it should out correctly.

For looping the query, I tried this code with no result.

while ($contriUser = db_fetch_object($mce)) {
  $contriUser [] = $contriUser->uid;
}

I have also tried the following code.

while ($contriUser = db_fetch_object($mce)) {
  var_dump($contriUser);
}

Any help on how to solve this or if someone has an alternative solution to get the most contributing members last seven days it would be much appreciated.


texts: How can I add a currency field to a content type?

texts:
I would like to have a field that accepts U.S. dollar amount. I installed the module: https://www.drupal.org/project/currency. Structure > content type > I do not see a field type "Currency". I am not sure how I can add a field to accept USD amount.

How can I add the price field to the content type?


texts: When in account creation should I get auth session and ID?

texts:
I am using the Services module version 7.x-3.2.

Posting a new user object to user/register.json, I get a response with status equal to 200, and an object with only uid and uri. If I then post username+password to login, I get a response with status equal to 406, and an "Already logged in" message. Then, if I post a new node object to node/, I get the message that I need authentication.

When, in the account creation process, am I supposed to get my session name, and ID so I can make authenticated requests?

Do I have to logout after creating the new account and log back in? This strange sequence is working, but logging out seems like it should be unnecessary.


texts: Rendering view output into a separate region

texts: For the sake of theming, I need to render the output of a view into a separate region. I could create a view block, but this way I lose the ability to pass contextual arguments to it. Any suggestions?


texts: Entity reference of a menu link gives Restricted access instead of the real data

texts:
I am trying to create an entity reference of a "menu link", but instead of having the menu link name I got  "- Restricted access -".
It seems to be the same problem with wysiwyg profile.
I'm using the last version of entity reference (7.x-1.1), event the dev version is the build.

I'm using admin with full right on everything.

Any idea why ?


texts: How to use Drupal for managing a public website together with an intranet and an MSSQL database?

texts:
I'm new to Drupal and I've been digging through the documentation to find out most of the features and possibilities of this software.

I'm asking you an advice in evaluating if Drupal could be the case for a CMS for a client of ours.

The client is an Italian public administration; right now they've got two sites: internet and intranet. The two sites feature different layouts and different content (some content is mirrored in both sites, some is only on internet and some is only on intranet). Right now everything is managed manually with classic xHTML and some programming.

In an effort to switch to a CMS (don't consider content migration right now) we have to deal with different infrastructure problems, such as:

the intranet site is behind a private LAN not accessible from outside
the internet site is on a DMZ with no link with the private LAN (and they want to stay it that way)
the client database option is SQL server (they could provide access on a shared database from both sites, this is ok, but it is the only link they could give)

So I have some trouble to find a good software that could solve most of their problems.
How to:

Let them have only one administration panel (content is managed only once)
Let them choose if the content added has to appear on one of the two or on both sites
How to sync the files uploaded on both sites (if files are stored in the db it shouldn't be a problem)
Is there some module that can let editors to insert images directly in articles (let's suppose they have wysisyg editors for content) and save those attachment in the db (same problem as n. 3)
Manage different layouts on sites and also different content organization (menù, views, blocks etc.)

What do you think about it?


texts:
I'm trying to build a site which should have gallery functionality. I think we should be able to solve this with Drupal 7. So my question is: is there any module/feature etc. (or any combination of modules), which can solve the following?

The site is on Drupal 7.
(A) We will have a gallery manager role. Every user with that role should be able to upload and manage his/her own galleries. We will have at least 10 person with this role.
(B) A gallery should be able to contain/display/manage ~100 pictures, so batch uploading and editing (for captions, ordering, etc.) is necessary.
Support for usual Drupal goodies like image styles, Views etc.
Support for a clearbox-like display, preferably integration with the Colorbox module.
Support for YouTube videos in galleries would be nice, but not a must have.

I've already checked a lot of suggestions in the topic. Alternatives that probably won't work in my case (please correct me if I'm wrong):

A Drupal 7 version of Node Gallery would solve almost all of this, but it's not likely that we will see anything like that soon.
edit: Node Gallery is now completely and totally unsupported, meaning that we won't see a D7 port ever.
Media Gallery is a somewhat incomplete module - I've tried to build the functionality above with that, but I can't see any way to support point (A), not to mention a big bunch of bugs that would make it impossible to use it on a production site. Also it's not maintained well.
Field Slideshow is just a nice formatter, I don't think it's possible to use anything like that in my use case. As far as I can understand, a formatter-based solution won't scale well enough for (B), not to mention the missing management functionality. Gallery formatter is the same from my point of view.

I would appreciate any suggestions on solving this. I'm not afraid of building something from scratch (whether it means playing around in Views, coding or both), but at least I would like to know where to start to achieve all of this.


texts:
In a Drupal 7 project I'm working on I need to install Drush in order to perform a variety of operations.  The only trouble I see is that the latest Drush installer for windows only goes up to version 6.  I can install Drush 7 using cygwin, but I want to verify that I'm not missing something.  It seems logical that the Drush versions might be synced up with the Drupal version, but perhaps there is some cross version compatibility or something else I'm missing.

If I want to use drush commands on a drupal 7 site do I need to use Drush version 7?

If so is cygwin probably the best way to get Drush 7 up and running on a windows 8 machine?


texts: Add Attribute to Textfields in Admin Theme

texts:
I'm often working with Pages in RTL Languages where the default Theme and also the admin theme are using RTL languages.

What often bothers me, is to use LTR texts like Tokens or Paths in Textfields, because the specialchars like / or [ are shifted.

To solve this, i would like to add the dir=auto attribute to all Textfields in admin Theme.

So the textfields should look like this:

< input type="text" id="edit-file-public-path" name="file_public_path" value="sites/default/files" size="60" maxlength="255" class="form-text" dir="auto">

My idea was to create a Subtheme of Seven and use the template_preprocess_field function to add the dir attribute to all fields.

My issue is, that my Preprocess function is never called.

Are the preprocess functions called in admin Theme? And is there an another way to do this?

myseven.info file:

name = My Seven
description = Admin theme based on seven admin Theme
package = Core
version = 1.0
core = 7.x
base theme = seven
stylesheets[all][] = css/myseven.css
settings[shortcut_module_link] = 1
regions[content] = Content
regions[help] = Help
regions[page_top] = Page top
regions[page_bottom] = Page bottom
regions[sidebar_first] = First sidebar
regions_hidden[] = sidebar_first

template.php Function

function myseven_preprocess_field(&$variables, $hook){
    dsm($variables);
    watchdog("Hello World!","The preprocess_field Works!"); //if this function is ever called there should be an entry in Reports
    }


texts: Create editable autofilled form with content from node and user

texts: I have custom content type and I want a link inside the node that will create an editable form and auto-fill fields in the form with content from the node and content from the logged in user. The editable fields on the form will be user generated text only. Completed form will need to be downloadable pdf.


texts: remove drupal admin menu from actual site

texts:
i'm using drupal 7 and i want to hide the admin toolbar from the normal sites. but in the configuration i can only find the option to disable the toolbar completely. what i want is that it is only visible on "mysite.com/admin/" and removed from the actual website.

i found some drupal modules with which you can collapse the toolbar or hide it by pressing the UP key but what i want the complete admin toolbar markup gone on my actual site.

i'm removing all the drupal system css and js anyway (using the template.php file) so even if i wanted the admin toolbar on my sites it would look messed up because of the missing styles and scripts.

any ideas?


texts:
I am using Services Entity Module

I am trying to POST to http://example.com/rest/entity_message

and Getting this error 401 Unauthorized : Missing required argument values

Can anyone tell what I should enter in body area ?


texts: No one can login and access denied message

texts:
The site worked till yesterday and just now it's behaving strangely.

The site is not created with features, an archive dump including the code and database is copied to server, and the old installation is replaced with the new one manually (unfortunately). Now it is irrelavant  also happening on local server.
No caching module is installed. Session API is not also installed.
Theme is set to 'seven' (core admin theme, just in case).
The watchdog does not contain any error, warning or info except the usual "session opened for user xyz";
The settings file does not contain any special cookie directive. It never did.
The site is running on php 5.6, Apache 2.2, CentOS 6. PHP is running as fast-cgi. Same as always.
It's Drupal 7.

I go to example.com/user/login, enter username and password, the form is submitted successfully, the page is redirected to example.com/user/%uid (tried both uid 1 and other users). and boom! I get an access denied. And the user is not logged in.

If I truncate the sessions table with truncate table sessions I can log in once and once only, with any user. Then again no one can log-in not even uid 1.

Also with a password reset link (using the command drush uli I can log in with no problem).

I disabled all contrib modules and theme, but the same problem persists.

What is causing such problems with sessions? any ideas?


texts: How to convert Json data directly into xml - standardized way?

texts:
I'm having a Json:

[{"S":"a","D":"b"},{"S":"s1","D":"m1"},{"S":"2","D":"3"},{"S":"4","D":"5"}]

And I want it to convert into XML:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Us>
    <U1>
        <S>a</S>
        <D>b</D>
    </U1>
    <U1>
        <S>s1</S>
        <D>m1</D>
    </U1>
</Us>

I know the php way, first decoding json using Json_decode() and a bunch of foreach loop that finally generate XML.

But I want in Drupal way. There is a module serialization in core of Drupal 8. But don't know how can I take the services from that module in my custom one.

Also, I got a link, How to get it done using symfony, but again it seems like Drupal 8 standards are lacking somewhere by me.

What's the right approach to achieve this in Drupal way.


texts: Change field value with hook_views_pre_render()

texts:
I'm using Views in 8.4.0 and attempting to change the output of a field value with  hook_views_pre_render(). The default value of the field is a node ID. The intent is to replaced the value with a static string depending on a whether or not it's contained in a predefined array using in_array().

The aforementioned is relatively straightforward.

I begin by looping through the results:

  for ($i = 0; $i < count($view->result); $i++) {
    if (isset($view->result[$i]->node_field_data_node__field_lesson_nid)) {
      $viewed = in_array($view->result[$i]->node_field_data_node__field_lesson_nid, $viewed) ? 'yes' : 'no';
      // Replace the default Node ID value with $viewed.
      ...
    }
  }

The array $viewed contains a list of predefined node IDs. If the node ID exists in the array "yes" is output otherwise "no".

The problem is how to output the value for each row of results within the View object.

I tried the following at the above ellipsis:

      $view->field['nid_2']->options['alter']['text'] = $viewed;
      $view->field['nid_2']->options['alter']['alter_text'] = TRUE;

"nid_2" is the token for node_field_data_node__field_lesson_nid.

The problem is this changes the field value for every row. The last row in the results determines the value. (The View also has multiple joins (relationships) which further compounds the complexity.)

So my dilemma is where to replace the value within each row of the $view->result.


texts: HTML / Mail System / SMTP Not sending approval in html

texts: I have a current Drupal site that sends out all emails using the HTML template. Users requests, reset password, webform but does not send out approvals in HTML. Anyone have this issue or know a solution?


texts: Get results from content indexed from other site with search api

texts:
We are using the Search API module to implement the search pages on the site.

Current setup:

A custom backend to store the index. It is powered by Lucene. We were able to get a new search API backend plugin to do CRUD on the indexes.
This backend also implements the search functionality. It is implemented alright and I am able to retrieve the results in the view of the index.

Requirement:
The custom backend is used by other sites as well (not necessarily on Drupal) to store their index. I want to display results of these sites as well whenever a user does a search on our site.
However, there seems to a limitation in a way Search API module works.

In the custom backend we created, there are following lines which are responsible for letting the module know about the results

$item = $this->getFieldsHelper()->createItem($index, $row->item_id);
$results->addResultItem($item);

We took the Database backend as a reference to build this custom functionality from the search_api_db module which is a part of the search_api module.

Question: How do I display results from other sites along with the current Drupal site?


texts: How do I hide the end date part of a Date field but not the time?

texts: I have a content type that uses Date, it has a start date with time, and end date and can even repeat. But I need to hide the part of date that handles the end date and leave just the time, most events in this content type happen the same day, so that the user doesn't gets confused when making a new node of this particular content type. Any ideas?


texts: Find the password for user admin from a replicated old version of site

texts:
I have access to a copy of an old version of a production site on a dev server, but the owner of the website on prod has lost his credentials to admin and doesn't know his ssh login credentials. The only option for me to do his content updates is via the drupal web interface.

I'm able to get into the dev site via drush uli admin, but I need the password extracted from the dev server in order to get into the prod website.

How can this be done?


texts:
We are looking for a way to show banners on pages based on their URL parent. There are multiple banners in use, and each page should display a banner based on its parent page. We want to build this into the theme, if at all possible.

So, for the Programs section, the Programs banner should display. However, within Programs there are named Programs with their own banners, such as "Great Program" and "Program For Winners" which each have their own sub-pages. When on those sub-pages, we want only the banner for the specific program to show.

/programs - Show Programs banner (top-level parent)

/programs/all - Show Programs banner

/programs/great-program - Show Great Program banner (second-level parent)

/programs/great-program/about-great-program - Show Great Program banner

Note: I'm using D7, and probably using blocks, maybe Views. Open to all suggestions.


texts: Multiple databases: store users in remote database

texts:
I want to have one site with two different databases: one should store users and other should store the rest. Databases are on independent servers.
I know that in settings.php there can be several databse connections. But how can I tell the User module not to use default one?


texts: Are page caching and cache tags related?

texts:
I'm working with a site which has page cache enabled.
I'd like the page cache for any given node to invalidate when that node is changed. There's a lot of examples out there dealing with cache tags, but I haven't had any luck figuring out the relationship between page caching and cache tags.
I've got a node which starts out being published. I then unpublish it, and publish it again. When I publish it for the second time, the page cache still treats it as unpublished. It does so until i clear the entire (page) cache.
It seems that the cache_page entry is updated when i update a published node, but whenever the node goes from unpublished to published - the page cache entry doesn't follow.
I've tried implementing hook_entity_update and do a Cache::invalidateTags(['node:19']);, but that had no impact.
Is it possible to use cache tags to invalidate page cache entries?


texts: Allow all users to view all groups (private or public) with Organic groups, but not private content

texts:
I am using Drupal 7.25 (I need to update to 7.26) and organic groups 7.x-2.4.  I currently have public and private groups working.  I have two users (admin and a normal user).  I have a menu tab that opens the og list (/og-list) view which I want to list all groups (public or private)

Currently all public groups show up for the normal user.  The private groups are still not shown in this list to the normal user.  If I log in as admin they see all private and public groups.

How can I make private groups show up in this list to all users?  When they click on the group they shouldn't be able to view the content, just the group name and a subscription link.  If I type in the direct link to the group is gives me an an Access is denied page.

Thanks for the help!


texts:
I am using Quick Tabs for displaying the image gallery.

In views the FORMAT is Quicktab and the fields are Year ,Month ,Title and Images .

I have a gallery based on Year and month.I need to display the gallery based on year(main tab) under the year tab the month tab should be displayed.

e.g :
here under the year i need to display the months entered in the content type.Now in view's Quicktab format option i gave Grouping field Nr.1 as Year.When i tried the Grouping field Nr.2 to Month,the tab is not showing anything or the combination not working.

How can i show the nested tab in Quicktab or can you suggest any alternative ways?


texts: Rules add date variable from webform submission

texts: I have a webform where the user also submits date. I would like to populate a date type field with the submitted date. I tried making variable by "Add variable", but I do not know how to access my webform submission.


texts: Archive block giving SQLSTATE[42000] error

texts:
I'm trying to make a view archive block to filter my posts by year and month etc. I'm following http://chrisshattuck.com/blog/how-create-monthly-archive-block-drupal-blog-views, but I keep getting an SQL error.

See below my error and the running query also. Anyone have any ideas what I'm doing wrong?


texts: As I'm not quite happy with the Simplenews module I want to use phplist instead. The newsletter should contain the teasers of the articles I want to send. Is there a way to export specific articles teasers to HTML (using a custom template), so that I don't have to copy and paste every single teaser to my newsletter?


texts: maxlength depending on nodetype (contenttype)

texts: i use one field in different content-types. for example in article, this field should be limited to 130 characters, but in gallery, the same field should be limited to 50 characters. The field is also used to generate the breadcrumb menu, so i can not simply add another field. so is it possible, to set different maxlength-values depending on the nodetype?


texts: How to easily create a landing page for contents with specific tag

texts:
I'm building an intranet portal for a non-profit organization I work in, and currently figuring out how to make it easier for my colleagues to build a landing page that displays all contents tagged with x. For example, if they create a landing page called Jobs, all contents tagged with jobs will be updated on the Jobs page.

Think of it similar to OpenAtrium where you could create a section, then upon creating a content you could choose which section it will get automatically posted to.

Currently this is doable by:

1) Users creating a tag (i.e 'jobs'), then creating a view to pull all contents tagged with jobs. But this means I will have to give them permission to taxonomy, views, and page manager. Plus, the steps and interface are too daunting.

2) Using Panopoly module, I can easily add a 'content list' pane that can choose between different content type. Unfortunately it doesn't have an option to filter by tags. Is there any way to include this?

Is there a better way to do this?


texts: How to move Drupal 8 with composer, to another server

texts:
We've recently got a few Drupal 8 sites, and needed to move them away from a plesk server. The plesk server is now shutdown for good, and we need to restore the sites on our cpanel server. The sites are using composer, which we don't have any experience with. On top of that, we are not very familier with the drupal structure or system.

We've tried to restore the sites by copying the files relatively with the composer "vendor" folder and replacing strings in the entire project, but it didn't seem to work, or maybe we missed something..

We've also tried to create a new composer project and copied the drupal project into the newly created composer project, but that gave an infinite loop that used up all the ressources and gave an 503 error in the end.

Does anyone know how to move/migrate a Drupal 8 site with composer, from one server to another?


texts: CAS module - disabling auto login / want nonpersistent cookies - deleted when browser closes

texts:
Our security team says we need to modify the cas module so that it either deletes the session cookies when the browser closes or use a session variable rather than a cookie. I can't figure out how to satisfy their requirements. I don't see such a setting in the cas module.

Currently, the cas module auto logs in users even though the Gateway autologin setting is disabled. The security team says this is OK on the first load but after the browser is closed, the site is not reauthenticating but instead relying on the cookie which is not acceptable. I don't know how they know this is what is happening.

I'm using Drupal 8.5.3.

It seems to me that the CAS settings under Configuration -> CAS

Gateway Feature (Auto Login)
when the radio button "disable gateway feature" is checked, that users should be required to login but though this option is checked, they are not required to login.

The cas module READ.md file writes this about the Gateway feature,
 "This feature is not currently compatible with any form of page caching."

Page caching is disabled in settings

$settings['cache']['bins']['render'] = 'cache.backend.null';

Dynamic Page cache is also disabled

$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';

In addition, the CAS settings "Forced Login" is enabled.

php.ini has cookie lifetime set to 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.

session.cookie_lifetime = 0

Thanks for any help.

Resolved:

I resolved this issue by making the following changes to the following files:

core.services.yml
default.services.yml
services.yml

# Set session cookie lifetime (in seconds), i.e. the time from the session
# is created to the cookie expires, i.e. when the browser is expected to
# discard the cookie. The value 0 means "until the browser is closed".
# @default 2000000
cookie_lifetime: 0


texts: May I know the difference between field_data_body and field_revision_body?

texts: As I am a beginner of this Drupal 7 I have some doubts regarding these database tables.I need  a short notes regarding all these database tables.The doubt which I had found is that when I add the content in Drupal 7 it is inserting in these two database tables i,e field_data_body and field_revision_body and in similar way when I add comment it is also doing the same functionality. I need someone's help.


texts: Drupal Ubercart Merchant ID and Key are incorrect?

texts:
When I checkout in Ubercart the merchant key and merchant id are incorrect. In my configuration they are correct, but when the login credentials are displayed during checkout, they are jumbled.

I am using the uc_domain module to manage different payment gateways per domain. My original domain is working correctly, but my new domain, as seen in the image, is not working correctly.

The main error that I am getting is this:

  DOMDocument::loadXML() [function.DOMDocument-loadXML]: error parsing
  attribute name in Entity, line: 1 in
  .../ubercart/payment/uc_cybersource/uc_cybersource.soap.inc on line
  31.

Screenshot:
 http://yfrog.com/gzv1tpp


texts: 'drush field-create' with type INTEGER from command line? drupal (ver 7.22) | drush (ver 6)

texts:
tried to manage fields of tpye 'int' with drush (batch), without success!

working:
drush field-create user streetname,text,text_textfield --entity_type=user

not working:
drush field-create user streetnumber,integer,text_textfield --entity_type=user

workaround:
drush field-create streetnumber --entity_type=user
-> offers interactive dialog only
Field name: ...
Choose a field type ...
Choose a widget ...
--> '_http://default//fields/streetnumber'

Maybe there's another way to provide data, like

drush field-create user streetnumber < inputfile ??
drush field-create user streetnumber < 'fieldname_XYZ','6','1' ??

any ideas?


texts: A custom Field with #submit function can't pass value

texts:
i wrote a custom field and i want to do mini validation just in the custom field.

The only input data are the cellphone textfield. The other form fields all are used for validation.

However, i can't pass the value of the field.

Is there something wrong?

 function cellphonefield_field_widget_form(&$form,&$form_state,$field,$instance,$langcode,$items,$delta,$element)
    {
        $base=$element;

      dpm($items[$delta]['cellphone']);

        $element['cellphone']=array(
             '#type' => 'textfield',
         '#title'=>t('Enter your Cell phone Number!'),
         '#description'=>t('System will send you a message '),
         '#default_value'=>isset($items[$delta]['cellphone'])?$items[$delta]['cellphone']:'test for this field',
        )+$base;

      $form['send_sms']=array(
             '#type' => 'submit',
             '#name' => 'send_sms',
             '#title' => t('validate your cellphone number'),
           '#value'=>t('Send Me Validate Code'),
         '#weight'=>1,
         '#limit_validation_errors'=>array(
         array('cellphone')),
         '#submit'=>array('send_sms_function'),
        );

      $form['validate_code']=array(
             '#type' => 'textfield',
         '#name' => 'validate_code',
         '#size' => 20,
         '#title'=> t('Enter the validation code !'),
         '#description'=>t('Please check your cell phone sms message and then enter the code in the sms.'),
         '#weight'=>2,

        );

      $form['validate_button']=array(
             '#type' => 'submit',
             '#name' => 'validate_button',
             '#title' => t('validate your cellphone number'),
           '#value'=>t('Validate'),
         '#weight'=>3,
         '#limit_validation_errors'=>array(),
         '#submit' => array('send_sms_function'),
        );

        $form['submit_message']=array(
        '#type'=>'item',
        '#title'=>t('Cell Phone'),
        '#description'=>t('Your phone is been validated!'),
        '#weight'=>4,
      );

        return $element;
    }

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

$cellphone=$form_state['values']['cellphone'];
      dpm($cellphone);
          }


texts: I'm using clientside validation module. It highlights only errors. How to display for example a green mark beside valid form elements?


texts: hierarchical select not working in multistep form

texts:
I have created multistep form with help of

link
 and created hierarchial select in step 1.It is working for step 1
but when i click next button and goes to step2, and return step1 it is not working.

Please Help.


texts: I just checked that an alias path named, say, any/path can point to N different existing paths. Is there any fixed precedence order as per which one will be processed? Or is it a random order?


texts: I'm using an accordion list. In my file views-views-accordion.tpl.php want to print a div before the title of each article. I'm using the latest version of drupal and views. Any idea?


texts: How to remove a value from URL parameter?

texts:
I'm using entity reference prepopulate and views. On the start of my node add form I'm using views to display some products and I have created a PHP button to pass the nid of those products to the URL. Here is the code:

<?php
$url = token_replace('[current-page:url]');
$l = l( t('SELECT THIS VENUE'), $url,  array('query' => array('field_product_venue' =>$row->nid )  ));
echo $l;
?>

And on the last part of my node add form the user can see the summary of all the products he or she has chosen but he or she must also have the ability to remove those items, since the form gets its selected products from the url I want to create a button that deletes that specific product (nid) from the URL.

Any help would be greatly appreciated.


texts: geolocalization in views filter proximity

texts:
I wants to get the coordinates in proximity filter on views in location module, so i also wants to use the html5 and not a ip localization.

I found this patch that i can fast change, but i wants now to obtain the position with html5 and save it in  $geoip_location->latitude; (in this example). How can i get the longitude and latitude of the anonymous user and use it in lcoation proximity filter in views (that only allow php)?

Thanks


texts:
I am working in drupal-6 trying to do facebook connect button.

I installed fboauth module sucessfully. now i also  got fb connect button and also able to connect successfully. now first time i allow application for this. it works successfully.  Now
When i logout from website as well as from Fb. then try to connect fb coonect it goes to app page after login. i want it directly goes to my website. when i logged in ..

Any body have idea?


texts: Register the user from the login form itself

texts:
I want to create new accounts only if user name and password have matched with that of with Active Directory.

So if a completely new user tries to login and enters correct Active Directory login & password then I'm adding him/her using user_save in the form validator.

But at the same time I'm returning with error that "please re-login".

However I want a seamless login. That is if a new user tries to login -- I'll create a new user and at the same time he/she should also be logged in.

How can I do this?


texts: Best way to register a new Drupal user via a 3rd party application

texts:
We have a Java application on our server, when users provide their email and username to it I want it to send the username and email to our Drupal site to register them for an account. And I'd like them to still receive Drupal's welcome email containing their password.

What's the best way to achieve this, I was thinking possibly the services module? But wasn't sure if there'd be a better solution because the Java code and Drupal site are on the same server and therefore we could have some pretty direct integration.


texts: node.tpl render field from referenced entity

texts:
I have a node.tpl.php file where I need to output a field from an entity referenced via the entity module (a reference field). I have tried using:

print render($content['field_parent']['#items'][0]['entity']->field_main_image);

but nothing appears! I also tried this way:

$parent = node_load($node->field_parent['und'][0]['target_id']);
print render($parent->field_main_image);

I just would like to render() a related field just as I do with $content fields.

Any hints ?
Thank you


texts: How to use the language neutral url alias pattern in pathauto?

texts:
I want to use the following patterns in pathauto:

myCT All languages: pattern1
myCT neutral language: pattern2
myCT EN language: pattern2

So that all neutral (UND) and EN nodes of myCT have pattern2 and all other languages have pattern1. I'm using the ALL languages pattern for all other, as I have many other languages that should have the same pattern and I do not want to repeat it.

I'm using entity translation module for myCT.

When I create a node and save it having the default language (UND) and automatic path alias, pattern1 is always generated. I have to re-edit the node to have it get the correct pattern (for UND/neutral language), pattern2.

First of all, the pathauto_pattern_load_by_entity function (pathauto.module file) is called before the node creation, so the language of the node is always UND during creation of a node.

Second, trying to debug the pathauto module I can see the following:

function pathauto_pattern_load_by_entity($entity, $bundle = '', $language = LANGUAGE_NONE) {
  $patterns = &drupal_static(__FUNCTION__, array());

  $pattern_id = "$entity:$bundle:$language";
  if (!isset($patterns[$pattern_id])) {
    $variables = array();
    if ($language != LANGUAGE_NONE) {
      $variables[] = "pathauto_{$entity}_{$bundle}_{$language}_pattern";
    }
    if ($bundle) {
      $variables[] = "pathauto_{$entity}_{$bundle}_pattern";
    }
    $variables[] = "pathauto_{$entity}_pattern";

    foreach ($variables as $variable) {
      if ($pattern = trim(variable_get($variable, ''))) {
        break;
      }
    }

    $patterns[$pattern_id] = $pattern;
  }

  return $patterns[$pattern_id];
}

So in the following lines it seems that it never takes into account the neutral language path.

if ($language != LANGUAGE_NONE) {
   $variables[] = "pathauto_{$entity}_{$bundle}_{$language}_pattern";
}

Shouldn't that if statement be removed? How is it possible to use the neutral language path otherwise?


texts: How to use hook_form_alter to change the cancel link

texts:
I am trying to accomplish a very simple thing - changing the cancel link in the invite_withdraw_form function - with no success. The function is in this file http://cgit.drupalcode.org/invite/tree/includes/invite.pages.inc#n120 So my custom function looks likes this now:

function my_custom_module_form_invite_withdraw_form_alter($form, &$form_state) {
  debug($form['actions']['cancel']);
  $uid = $form['invite']['#value']->uid;
  $cancel = 'user/'.$uid.'/invites/pending';
  $form['actions']['cancel'] = array(
    '#type' => 'link',
    '#title' => 'Cancel',
    '#href' => $cancel,
    '#options' => array ('path' => $cancel),
  );
  debug($form['actions']['cancel']);
}

It hooks successfully, because I see output of two debugs, the second of which confirms the array has changed from:

array (
  '#type' => 'link',
  '#title' => 'Cancel',
  '#href' => '<front>',
  '#options' =>
  array (
    'path' => '<front>',
  ),
)

to

array (
  '#type' => 'link',
  '#title' => 'Cancel',
  '#href' => 'user/1/invites/pending',
  '#options' =>
  array (
    'path' => 'user/1/invites/pending',
  ),
)

but for some reason when I click the Cancel button it keeps redirecting me to the front page. What I am doing wrong and what is the right code?


texts: Only a view filters in exposed filter block

texts:
I have a view with 7 exposed filters in an exposed filters block.

But I only want to have 2 filters in the exposed form block. All 7 filters I want to have on the views page.

Is there another solution then display: none?


texts: Why does my theme's JS require that jquery.min.js be called from the theme's .info file?

texts:
My jQuery Update gives 1.12
and my theme has 1.12
but I can't make Drupal and the theme's JS use just one instance of it. If I don't include my theme's jQuery in the .info file, the theme doesn't work.

I've tried replacing it with template.php. That results in only one loaded but only the theme's JS works.

function abc_js_alter(&$javascript) {
    $javascript['sites/all/modules/jquery_update/replace/jquery/1.12/jquery.min.js']['data'] = 'sites/all/themes/abc/jquery.min.js';
}

I've tried preprocess_html. Same thing.

I've tried making sure the theme's JS is loaded at the bottom of the page in html.tpl.php so it's definitely after jQuery Update's file.

Is there some tenet of Drupal I'm missing here? This wasn't an issue apart from page size until now as having both files breaks an Ajax form I need.

Thanks


texts:
is there any module to add "table component" to webform?
I want to have a button to add a row to that table.it means that the rows count not limited and is added number of  user want.

sorry,my English not good ;)


texts: Retrieving entity data in views with dynamic (per-row) relationship

texts:
I have custom entity 'entitystatus' that holds 'entity_id' reference and 'entity_type' field.
Now I need to build a view that will display Entity statuses attached to different entity types (i.e. nodes and users) with entity titles:

| status | entity type | entity title |
---------------------------------------
| stat1  | node        | Node Title   |
---------------------------------------
| stat2  | user        | John Doe     |
---------------------------------------

So, I need dynamic table and field relation.
I'm trying to build custom relationship handler, but it seems that it can't handle individual per-row data.
Is it possible to fetch any entity-related fields in that hybrid view?
What is the best way to solve my problem?


texts:
I have a taxonomy term that has its own template, inside that template, there is custom links that just add a new argument to the URL
for example the current path is /taxonomy/term/%, one of the custom links will send the user to /taxonomy/term/%/%

with pathauto the url alias changes only when I visit /taxonomy/term/% (vocab_name/term_name), but it won't changed when I vist /taxonomy/term/%/%. I want it like that : vocab_name/term_name/%.

Is that possible ?
thanks in advance.


texts: How to give control of number of search results displayed to the user? Apache Solr

texts: I want to let user choose the number of search results that should be displayed in a search page powered by apache solr. The current setup I have only lets the admin choose the number of results to be displayed. Has anyone worked on such functionality before?


texts: Difference between content type and content entity

texts: What is the difference between content type and content entity?


texts:
A lot of our stuff has uris formatted like site/taxonomy/XX,  where XX is an integer.

I found a lot of questions like "how to get the TID from the name?", but I'd like to get the name from the TID. I'm trying to put together a breadcrumb script and everything is great except for these cases where I'm getting a trail like "home > term". Instead I want to have it like "home > <TERM NAME>".

How can I do so?


texts: Drush archive-restore not restoring database nor giving error

texts:
I have a Drupal 7 site and database in an archive created via Drush. I'm trying to restore it with Drush on a Mac running MAMP.

When I tell it to restore the site it says "[ok]" afterwards and the site files are in their correct destination, but it doesn't create and populate the database nor does it give an error that it couldn't.

I've made sure that their is a database user with the same name and password that is in the settings.php file.

My command is:
    drush archive-restore /Users/abailey/Downloads/dev-sbirt-reg.20140321_200259.tar.gz dev-sbirt-reg --destination=./dev-sbirt-reg

I added the -v tag hoping it might show me what the problem is and it outputs:

Mime type for                                                           [notice]
/Users/abailey/Downloads/dev-sbirt-reg.20140321_200259.tar.gz is
application/x-gzip
Executing: tar  -C /tmp/drush_tmp_1395439263_532cb69f676ea -xzf dev-sbirt-reg.20140321_200259.tar.gz
Archive restored to ./dev-sbirt-reg                                  [ok]
./dev-sbirt-reg
Command dispatch complete                                               [notice]

Any idea what I could be doing wrong or at least how I can figure out what I'm doing wrong? I would think at the very least I would get an error saying it can't connect to the database or something.

I'm running this from the directory I've set MAMP to use for holding site documents.

-Thanks


texts:
Running Drupal 7:

Problem: I have a vocabulary that contains a list of faculty, within each faculty member term page is a list of research interests (a separate vocabulary) that are clickable.  Currently they go to their individual term pages.

Goal: How can I make those "Research Interests" clickable and simply make it go to the search page with that term as the search query?


texts:
I want to use view to show car parts.

I have 2 exposed fields (car manufacturer and car part like doors light etc)
The view work nice but what i want is to have a way for example when user click at the first list (example Audi) to show if there is any part in the another list for parts.

Ex.
In Audi i have only Doors and not lights
When user select from first list Audi the list for part only show Doors.

So if Audi only have nodes for Doors will show in second exposed filter only the Doors option.

Drupal 7 views 3


texts: Image grid from view with randomly inserted colored squares

texts: I've got a creative challenge here.  I've got a view that creates a grid of images linking to their respective content, but my designer threw in a bit of a twist.  He wants me to randomly insert colored squares between every 2-3 images.  I was looking into creating a custom template for this view to do the inserting, but he'd also like these colors to be editable through the admin.  While there are many ways to accomplish this I'm curious to hear your solutions.  I could create a "Grid Color" content type, but I'm not sure I want to clutter my content types with such an obscure type.