texts:
In my Controller I'm loading a form with the following code.

$form = \Drupal::formBuilder()->getForm('Drupal\custom_module\Form\CustomForm');

Depending on different cases I would like to use different processing of the form.

I see 3 possibilities to handle this:

Use different forms and load the correct depending on the case
Include some hidden fields and evaluate these fields in the submit handler of the form
Use different submit handlers

I think the third possibility is the best one. But when I try to use a custom submit hanlders.

$form['#submit'] = 'custom_module_form_submit';
// or
$form['actions']['submit']['#submit'][] = 'custom_module_form_submit';

They both don't work. How can this be achieved? Is there a better way of doing this?


texts: Grant permission to current user at runtime in specific environment

texts:
Many Drupal contrib modules have inverse "feature flag" implementations vis-a-vis a killswitch variable added to settings.local.php to disable a feature:

// Killswitch setting.
$settings['disable_captcha'] = TRUE;

// Config override.
$config['google_analytics.settings']['account'] = '';

However, the Drupal 8 version of CAPTCHA does not yet have the disable_captcha killswitch that existed in Drupal 7 (see related issue #2836076).

The module does have another kind of killswitch via a Drupal permission skip CAPTCHA.  This got me wondering:

Is it possible to dynamically add a permission to the current site visitor—both anonymous or authenticated users—at runtime for a specific environment without affecting the standard roles & permissions store so that configuration management/sync is not adversely affected by the environment-specific permission?

Ideally this logic would be located in settings.local.php to avoid the following risks and technical debt

the chance that unintended environments would be affected, and
to have to copy/paste/commit solutions to this problem in every client project only to have to later remove that code once the proper killswitch solution in issue #2836076 lands.


texts: Theme Drupal Form API checkboxes as a grid

texts:
I have a custom form that displays a form element of about 2 dozen checkboxes. I would like to output them 3 per row, in a table if possible. How can I go about doing that?

$form['preference'] = array(
    '#type' => 'checkboxes',
      '#default_value' => 1373,
    '#required' => TRUE,
    '#title' => 'Choose all that apply',
    '#options' => $preference_options,
    '#prefix' => '
',
    '#suffix' => '
',
  );


texts: Creating content types, content type fields, vocabularies and panelizer panel configs manually in custom module?

texts:
I am a pretty seasoned Drupal developer and I maintain a distribution which is made up of a base theme, contrib modules, custom 'system' modules and a profile to glue it all together. My ambition is to develop a full suite of 'standard' modules like 'news' and 'events' which can be included as part of a site roll out (i.e. in the makefile). I already use features heavily to export, well, exportables, and I always ensure that nothing lives purely in the database unless appropriate.

My problem is when it comes to features and 'standard' modules. The idea is that standard modules can be used across many sites and generally cover 90% of use cases. There are of course times when a particular client has different needs, and I still want to use the standard module for sake of maintainability, but have some bespoke functionality present.

So here is the predicament. Let's say you have a 'news' module which exports:

content type [news_article]
fields [news_article_category],[news_article_image]
vocabulary [news_article_categories]
image formatter [news_article_image_formatter]
panelizer stuff [node:news_article:default],[node:page:news_article_list]

With features it's pretty trivial to export this all. But, as soon as, let's say, the client wants the news article display page (which is panelized) to be displayed differently, and you change it accordingly, you end up with a overridden feature. The solution? Well, features_overrides module would appear to solve this problem, but it just doesn't seem to work. The other solution is to not export these things as features and build them bespoke each time.

Now, if I could install these features in hook_install or similar, this would mean the basics would be available as standard, and then could be overridden on a bespoke site and featured out to keep the changes for that site in its relevant repository.

However, it's insanely verbose - to programatically write out what you can accomplish in 15 minutes in the UI (this is why I love/hate Drupal). Is there a way to export all config, like in features, but exported 'code' essentially can be placed in to an install hook, which installs the content type, fields, vocabulary, panelizer configs and all related settings on module install (think variables too, i.e. strongarm).

Note: I understand how to create a content type, and some simple fields in an install file. But the rest, which is easy with features would be nightmarish in a manual process.

Thanks in advance.


texts:
I have an url like this: http://drupal.dev/en/news-events

It's not my current page url. How can I get the page title by using above url ?


texts: Blocking IP Address In Drupal 7 Via Code

texts:
I want to know is there any function in DRUPAL 7 that I can send it an IP address as a parameter and it adds this ip to blacked_ips table ??

Indeed I have a rule that contains a Execution PHP action . In my action I want to add an IP to black list.


texts: cannot validate custom field widget for user profile field when editing node

texts: I have defined a field widget and set #element_validate to validate the input. This works fine when I create an account, but when I update the account, the field is not validated and does not even save the changes. It is as though the field doesn't exist


texts: Which entity to check in Rules to disallow taking a Quiz after passing it?

texts:
I need a way to restrict Quiz  access for users who have achieved a passing grade to stop them retaking the quiz to gain more user points.

It displays "You have already passed this Quiz.", but I can't find an entity to check for it with the Rules module. Previous quiz result fields always return 0 which makes them worthless. Assigning roles won't work because I want to have quizzes daily.

Any hints?

PS: I'm using Quiz 7.x-5.1


texts:
I want to enable pictures for users in drupal http://drupal.org/node/22271
and I am not sure how to chmod the directory so that users can save their pictures in it.

Thank you for your help in advance.


texts: Using hook_menu in a custom module, how do you add a menu item to more than one menu in Drupal 7?

texts:
I am working with Drupal 7.  I have created a custom module that supplies several menu items using hook_menu.  I am adding one of these menu items to the main menu:

$items['my-chapter'] = array(
    'title' => 'My Chapter',
    'page callback' => 'mymodule_my_chapter',
    'file' => 'includes/pages.inc',
    'menu_name' => 'main-menu',
    'weight' => '110',
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM,
  );

Adding the menu item to the main menu works fine using this code.  But I have a secondary menu that also needs this link.  Is there a way to add it to another menu in addition to the main menu I'm already adding it to?  Adding another $items['my-chapter'] will obviously just overwrite the previous one and the 'menu_name' only takes a single string.

Can anyone shed some light on how/if this can be done?  Thanks.


texts: Programmatically Create 'full_html' Page Node in Drupal 7

texts:
So I'm able to create a page programmatically, BUT even though I'm specifying the 'full_html' filter, the page is being created with the 'filtered_html' filter which means that the code I'm writing to the page after it's created is being stripped out.  Here's the line I'm using to set the filter type:

$node->body[$node->language][0]['format'] = 'full_html';

Why is the filter type being ignored when the node is created?

Thanks in advance,
Bryan


texts: I am using vies3, profile2 and context to display the users created content on their profile2 page. Using context i can allow the block to be display on the users drupal profile, how can i extend this to only show the block on the users profile2 profile?


texts:
Dead configuration link

Hi, I am developing a Drupal 7 website with MAMP and everything works ok, except that when I access on some configuration pages, all that appears is a non themed breadcrumd and the page title on a white background. The Database was migrated from a Windows 7 WAMP install, and the pages display correctly on that machine.


texts: How to resolve this fatal error '2006 MYSQL server has gone away'?

texts:
I'm trying to send 750 emails through cron job.
After it sends nearly 40 emails, like after a few minutes it throws this error,

  Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /public_html/ehs/includes/database/database.inc:2171 Stack trace: #0 /public_html/ehs/includes/database/database.inc(2171): PDOStatement->execute(Array) #1 /public_html/ehs/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array) #2 /public_html/ehs/includes/database/database.inc(2350): DatabaseConnection->query('select name, d...', Array, Array) #3 /public_html/ehs/sites/all/modules/elysia_cron/elysia_cron.module(424): db_query('select name, d...', Array) #4 /public_html/ehs/sites/all/modules/elysia_cron/elysia_cron.module(632): elysia_cron_get('rules_cron', false, 'running', 0, false) #5 /public_html/ehs/sites/all/modules/elysia_cron/elysia_cron.admin.inc(753): elysia_cron_is_job_running('rules_cron') #6 [internal function]: elysia_cron_execute_page_cleanup() #7 {main} in /public_html/ehs/includes/database/database.inc on line 2171

I have tried upgrading max_allowed_packet to 500M under [mysqld] in my.ini and also php_memory_limit to 1024M, but still it didn't improve anything.
Is there any other possible thing I could do to resolve it?

FYI, I'm sending a view in emails to all the users using Insert view. The views are generated per user basis, and that involves aggregation operations and computed fields.


texts: I have a site with puzzle and I need to hide or show some answer. It can be some photo or some text. It can't be block, I need a module that will be able to hide or show fields as is it done in the photo modules When I add some photo in any article. How can I hide or show it?


texts: call filter date on views global php by defaultviews_handler_filter_date

texts:
I use the 'Datex'-module to use a Persian calendar. I want to call a period of dates in views that is exposed filter. How could I call default handler in views?

More specific:

A user chooses a period of dates, like so:
1393-11-01 to 1393-11-12
and in my database these records have the 'Gregorian' format. 'Views'-module by itself changes the format of the Persian date to 'Gregorian' in its query.

I get values, like this:

$view = views_get_current_view();
$datemin = $view->exposed_input['field_date_value']['min']['datex_edit_field_date_value_min'];

Now how could I call handler?

OR how could I understand what the 'Views'-module does to change the format of the date by itself, i.e. from Persian to Gregorian?


texts: How to reference existing entity using Inline Entity Form?

texts:
I'm using Entity Reference to create tasks in lists - both tasks and lists are content type, list contains multivalue Entity Reference to task. Because most tasks belong to only one list, it was only natural to use Inline Entity Form.

Problem is most - there are some tasks that needs to belong to many lists.

Module's docs says:

  Existing entities can also be referenced.

That would do the trick. My question is very simple: How do I do that? Only button I see is "Add new node", and it opens node creation form. What should I do to see "Add existing node"?


texts: How does one compare a date field with the non-UTC user/system time?

texts:
Date field data won't always correspond to UTC. From a user perspective, these dates are assumed to be in the user's timezone.  However, it is currently not possible to store dates in timezones other than UTC, at least until Add ability to select a timezone for datetime field gets in.

So when comparing these fields to the current time, the timezones won't match because the current time is in the local timezone and the field data is in UTC. We therefore need to adjust the current time to match the incorrect date field timezone (or vice versa).

What's a good solution for this?


texts:
I'm exploring Drupal 8 Twig system.
After I altered menu.html.twig I tried to print out menu items list, but when I load the page after appending {{ dump( items ) }} it all stucks, page is not loading, Apache process is at 15% CPU. Why is this happening? Can I somehow print out all item's content?


texts:
I'm trying to print Node Registration form so I used this code in node.tpl.php:

<?php
$form = drupal_get_form('node-registration-form');
print drupal_render($form);
?>

I've also tried id node_registration_form but it didn't work. Any ideas why?

EDIT 1:
Ok, so i used this in template.php:

function mytheme_preprocess_page(&$vars){
  $myspecialform = drupal_render(drupal_get_form('node_registration_form'));
  $vars['node_registration_form'] = $myspecialform;
}

and print $myspecialform; in node.tpl.php and it works but i got this error now:

  Fatal error: Call to a member function capacity() on null in
  C:\xampp\htdocs\dev\sites\all\modules\node_registration\includes\node_registration.forms.inc
  on line 676

Should i alter the form in template.php and add capacity input?

EDIT 2:

Nevermind guys, this module provides a node registration form block. I'm blind :) But thanks for help!


texts:
I'm trying to basicly glue/patch/fix a Drupal project so that I can edit it simpler. There's too much duplicated code which I want to make into the same function.

To do this I have to, from my own knowledge, handle modules. What I'm curious about is: What is the ideal way to structure these new functions?

Should I create a module called global_fixes, or should I add new functions to the existing modules? Feel free to share your solutions if you have been given a similiar situation.


texts: Change 'href' attribute in AJAX enabled links

texts:
I have some links with the class use-ajax. Everything works fine with default settings.

The problem is that at some point I need to change the href attribute of a link and make the ajax call to the new url, which is not working. The call is made to the initial url of that link.

I tried to reattach behaviours but this doesn't seem to work.

Any help would be appreciated.

Any ideas? Thanks


texts: Why does drupal set a menu link which redirects to a node as the active trail rather than the node's menu link?

texts:
I know the question might be hard to understand, so here's the problem:

I have this menu:

a

b
c

d

e
f (which has the url "/lorem/ipsum")

So, when I click on f the active trail is d > f, just as supposed to be.

The problem is, inside submenu a shall be another menu link which has the same link as f, i.e. "/lorem/ipsum". So I added a menu link and the menu looks like this:

a

b
c
g (which links to "/lorem/ipsum")

d

e
f (which has the url "/lorem/ipsum")

So now, when I click on the menu link g the site "/lorem/ipsum" opens, but now the active trail is a > g and not d > f. I just want g to be a redirect to that node/url. How to do that?


texts: EntityMalformedException: Missing bundle property on entity of type node in modal

texts:
I want to open create content type in modal, according to modal form and modal api example, I implement it, I test

the problem is here
when I test it by contact form

    ctools_include('modal');
  ctools_include('ajax');
  $form_state = array(
    // 'title' => t('Contact'),
    'ajax' => TRUE,
  );
  module_load_include('inc', 'contact', 'contact.pages');
  $output = ctools_modal_form_wrapper('contact_site_form', $form_state);

every thing work correctly and  there is no problem,but when I change it to

ctools_include('modal');
  ctools_include('ajax');
  $form_state = array(
    // 'title' => t('Contact'),
    'ajax' => TRUE,
  );
module_load_include('inc', 'node', 'node.pages');
$output = ctools_modal_form_wrapper('page_node_form', $form_state);

return me **
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /drupal-7.24/share/ajax/1
StatusText: Service unavailable (with message)
ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7724 of /includes/common.inc).** , where is the problem?

I create a menu, and it open a modal,I want add content in that modal


texts: Restrict a menu item only for a particular accessible after loggin and optionally for a role

texts:
This is the menu I have.

  $items['start'] = array(
    'title' => 'Take A Test',
    'page callback' => 'qe_start',
    'access callback' => TRUE,
    'expanded' => TRUE,
  );

return $items;

What should be passed in this to make it accessible to a role/logged in user?

'access arguments'    => array('content'),

And how can I make this to a callback_menu?


texts:
I have been trying to figure out how to decode ( also try to encode) my YML file so I can have full control over on PHP array. I try this...

And as you can see, I did not get the information inside of the YML file.

My question is what I'm doing wrong ? Why is not showing me the information inside of /core/modules/toolbar/toolbar.breakpoints.yml file?

Here is code snippet...

use Drupal\Component\Serialization\Yaml;

$breakpointEncoded = Yaml::encode('/core/modules/toolbar/toolbar.breakpoints.yml');
var_dump($breakpointEncoded);


texts: Does the Transliteration module alter the existing URLs?

texts:
I want to install the Transliteration module for a site on Drupal.

If I install this module, would it also change existing URLs (if I enabled it in the Pathauto module settings), or would it change just the new urls? I don't to alter the existing URLs.


texts: Show specific number of items on paragraph field

texts:
I have configured a field like this:

When I create a Node, the field shows like this:

How can I, programmatically, start this field with two elements and not have to click on the "Add pet" button?
For example:


texts: Does the LDAP module encrypt directory queries?

texts: I'm using the LDAP module and do not have the Start-TLS box checked. Does this mean my directory queries are running over an insecure connection? Or are queries to the directory server always ran over SSL/TLS?


texts: Changing URL alias for search module action

texts:
I'm struggling to make the Search module recognize the presence of a URL alias that I created for 'search/node'. It however stubbornly uses the default path.

In my template I use something like:

function mytheme_form_alter(&$form, &$form_state, $form_id) {
  switch($form_id){
  case 'search_form':
    $form['#action'] = drupal_get_path_alias('/search/node'); // = '/' . drupal_get_path_alias('search/node') does not work either
    break;

  }
}

When the results are displayed, the URL still reads:

/search/node/[search-string]

Does anyone know whether the path is hard-coded and omits the alias function?


texts: Getting WSOD, can't view any errors even after editing index.php

texts:
I've tried entering:

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

at the beginning of my index.php file (after begin php tag and it hasn't done anything.  When I run cron, it comes back and tells me that everything is ok.

Here's a brief overview of things that have transpired today:

I updated my views modules and made a database backup (i have no idea
how to restore from this, btw)
I updated to core .24
I ran cron andfixed errors concerning .htaccess files. I followed this tutorial:
https://drupal.org/SA-CORE-2013-003
I turned off error reporting (cause it's a production server: www.jcoledesign.com is the address)
All hell broke loose.  At first it stopped loading some images, then it stopped loading all CSS, this is likely due to caching
I added the above code to my index.php file
I cleared cache, went back and tried to replace my .htdocs files with something more simplistic and still no go.

I'm running out of ideas and nothing I try from here or google seems to work.

Please help and thanks in advance!


texts: Use image style as formatter in panels pane. [D7]

texts:
How do you select/apply an image style to an image field that is contained in a panel (or mini-panel) pane?

I have added an image field to a panel pane, and the only option it gives me under formatter is "image." How do I get it to display all my image styles as formatters?


texts: Does the login-link users receive upon registration actually expire?

texts:
I'm trying to expand the duration for the expiration of the one-time-login for the initial registration process:

user clicks on "create new account"
after filling name and email and sending the request user gets notification with one-time-link

I have changed the duration of 'password_reset_timeout' with
drush config:set user.settings password_reset_timeout 100

to 100 sec for testing purposes. But the link does not expire after the set time...
When i use the "Reset your password" option and receive the one-time-login, the message on the page shows the expiration date, but this isn't shown on the login page whit the registration link.
So, does the registration one-time-link ever expire?


texts: After Core Update 8.5.9 to 8.6.7 404 page for anonymous user

texts:
After i updated my drupal core from 8.5.9 to 8.6.7 some pages aren't reachable for anonymous users (error 404), but when I'am logged in everything is showing up correct.

Sometimes I get an error (not there before the update):

    Notice: Undefined index: status in Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromSharedTables() (line 555 of <PATH TO SITE>/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php) #0

could there be a link between this 2 "problems"?

I already tested a module which should solve this problem, but it didn't.

Anyone has an idea how to solve this?

Regards

M.


texts: Feeds: is it possible to resume a partially finished (and locked) import job?

texts:
Yesterday I tried importing a very large (15K+) number of nodes (some with files attachments) using the feeds module (CSV mode). After a while, the feeds module gave me a timeout error, and now when I get back to the import page, the "status" block reads Importing - 5 % complete and the import button at the bottom of the page is disabled and reads Importing (5%). On the "Log" tab, there are no messages of any kind.

Is there any way for me to resume this job?

From what I see, my only options are:

unlock the job (via the "Unlock" tab)
delete the created items (via the "Delete items" tab)

Since the feeds module seems to know that the job is only partially done (and which nodes where already processed), I find it a bit strange that there are no options to resume it. Am I missing something?


texts: Drupal Cache send to a 404 page after a while

texts:
I have a multilingual website which use cache (views cache activated, performance on ...).

That website works well but, sometime, after a while, some homepages in others language are redirecting to a 404 page when we try to watch them unidentified. The homepage in main language still works fine.

So to solve that, i have to flush the cache and all the pages are accessible again.

But i can't each week survey my customer website just to watch if i need to flush the caches. So any idea to solve that definitely.

Thanks!


texts: If user requests page that is unpublished, gets permission denied and page dies with too many redirections

texts:
When users without permission to administer nodes want to see content that is unpublished, they get a redirect loop.
I would rather show them a "this content is not anymore available."

Why is the redirection loop happening?


texts: What's the syntax of drush generate --answers argument?

texts:
So I am trying to automate theme creation using drush.
There is no documentation on how to fill the --answers argument there
https://drushcommands.com/drush-9x/core/generate/

I have tried:

drush generate theme --answers='{"Theme name":"test", "Theme machine name":"test", "Base theme":"Classy"}'

to no avail:(


texts: How do I conditionally add JavaScript to the  tag of some pages?

texts:
We are looking for a way to conditionally add <script> to the page in the <head> tag with the purpose of having setting pages where we can add URLs paths, and only to those pages. If possible, add it as the very first item in the <head> tag.

Is there a module or a recommended way to do this?

We initially thought to use the following code.

mymodule.module

function  mymodule_page_attachments(array &$page) {
  $attachments['#attached']['library'][] = 'mymodule/myscript';
}

mymodule.libraries.yml

myscript:
  version: 1.x
  header: true
  js:
    /path/to/file: { external: true }


texts: Custom imported rules disappearing after updating module.rules.inc

texts:
I have rules imported from a custom module. They are defined in the module.rules.inc file.

They make use of custom conditions and actions which are defined in the same file as well.

Whenever I update any part of the code in module.rules.inc and clear cache, all custom rules disappear from the site.

To get them back working I have to uninstall the module completely and then install it again.

Any clues on what is going on? Any way to avoid this as it's prolonging the dev process?

Thanks!


texts: Custom taxonomy; link with two content types

texts:
I've successfully created a new content type ("my_type") and added a taxonomoy into it.

How can I combine this new taxonomy also with the default content type "post", so that I can select it in the default content type backend?


texts: Allowing a user to choose which image style they want for a single uploaded image

texts:
I have a views list showing a set of property's displaying address, image, description and price in a horizontal manner, each line is a new listing for a property.

the user simply uploads an image and clicks save. however I have recently been asked to allow for the user to again upload a single image, only this time select an image style that contains an an overlay or watermark image on top of the uploaded image.

I have managed to create the image styles with a watermark effect for each overlay image they requested such as "Available now", "Under Offer" ect. But I have absolutely no idea how I provide a choice for the user to select one of these image styles.

so to clarify the user would like to upload an image and then select a pre made image style under that uploaded image to apply a watermark over the top. I am having trouble providing a choice for the user to select. everything else has been achieved.

I hope this makes sense I have tried to be as detailed as i can and hope there is a solution to this. Thank you for everyone's time.


texts:
$results = db_query("select nid from {taxonomy_index} where tid = :tid", array(':tid' => arg(2)));
foreach ($results as $result) {
  $node = node_load($result->nid);
  echo $node->title;
}

I put the code in page--taxonomy.tpl.php, but there is no result. Why?

The output of print_r($results) is the following one.

DatabaseStatementBase Object
(
    [dbh] => DatabaseConnection_mysql Object
        (
            [shutdownRegistered:protected] =>
            [target:protected] => default
            [key:protected] => default
            [logger:protected] =>
            [transactionLayers:protected] => Array
                (
                )

            [driverClasses:protected] => Array
                (
                    [SelectQuery] => SelectQuery
                )

            [statementClass:protected] => DatabaseStatementBase
            [transactionSupport:protected] => 1
            [transactionalDDLSupport:protected] =>
            [temporaryNameIndex:protected] => 0
            [connectionOptions:protected] => Array
                (
                    [database] =>
                    [username] =>
                    [password] =>
                    [host] =>
                    [port] =>
                    [driver] =>
                    [prefix] => Array
                        (
                            [default] =>
                        )

                )

            [schema:protected] =>
            [prefixes:protected] => Array
                (
                    [default] =>
                )

            [prefixSearch:protected] => Array
                (
                    [0] => {
                    [1] => }
                )

            [prefixReplace:protected] => Array
                (
                    [0] =>
                    [1] =>
                )

        )

    [queryString] => select nid from taxonomy_index where tid = :tid


texts: Module update manually multiple versions at once

texts: Actually my website use module views 7.x-3.5 version. The last version is 7.x-3.11, so i need update. My question is if I can upgrade (replace folders and code) directly to version 7.x-3.11 and run mysite\update.php or I need apply each new version separately running update.php for each, e.g. views 7.x-3.6, views 7.x-3.7...


texts: Custom submission handler doesn't save the node

texts:
I have two form submission buttons: the normal one and one added via hook_form_alter.

I'm currently using the normal default one as a save button which updates the node content as normal.

The second one which is called submit does the same thing, but will be changing a checkbox via $form_state prior to saving the node content.

The code I'm using is the following one:

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

  if ($form_id == 'example_node_form') {

    //dpm($form);
    $form['actions']['finishbutton'] = [
      '#type'   => 'submit',
      '#value'  => t('Submit'),
      '#submit' => array_merge($form['actions']['submit']['#submit'], ['custom_submit']),
      '#weight' => 99,
    ];
  }
}

function custom_submit($form, &$form_state) {

  drupal_set_message(t('This works, but shows up after the node submit message'));

  // Shows after the node save message.
  dpm($form_state);

  // Doesn't update.
  $form_state['values']['field_nomination_submitted'][LANGUAGE_NONE][0]['value'] = 1;
}

My submission works, but the custom handler appears to be firing after the standard submission handler. Do I need to switch the array_merge order? Do I need to break this into separate functions? Do I potentially need to add a submit function inside of custom_submit?


texts: Migrate API - Multiple multi language images in nodes

texts:
I am using "migrate api" for migrate content from another database (not drupal database).

I need migrate multilingual content with multiple images associated where alt and title are also multilingual.

How must I build this migrate yml for the images?

I have the next config for a unique image file:

'field_image/target_id':
    plugin: migration
    migration: news_image
    source: file
'field_image/alt': 'alt text'

but I don't know how build this config for save multiple values instead one. I searched for examples and in documentation but I didn't find anything similar.

I don't need a manual, only a orientation of how must be the configuration.

Thanks!


texts:
After reading and searching through related topics, I have not seen any clear answer about how to show the file size in a Views created file list. Im using Drupal 7 and having File 7.14 field installed.

I was expecting to select a field in Views in order to show it as a third column in a list of files that can be downloaded (after Title and File).

I am not a programmer, and the only related issues I've seen so far is about editing php files.

Currently, as administrator, I see the file size when I edit the node containing the file. Why can this value not be used other than in edit mode?

To be complete I've added the query how it is now:

SELECT node.title AS node_title, node.nid AS nid, node.language AS node_language,   file_managed_file_usage.filesize AS file_managed_file_usage_filesize, 'node' AS  field_data_field_file_node_entity_type
FROM
{node} node
LEFT JOIN {file_usage} file_usage ON node.nid = file_usage.id AND file_usage.type = 'node'
LEFT JOIN {file_managed} file_managed_file_usage ON file_usage.fid = file_managed_file_usage.fid
WHERE (((node.status = '1') AND (node.type IN  ('file'))))
ORDER BY node_title ASC
LIMIT 50 OFFSET 0


texts: theming user profile with "User Field Privacy" - but no "Privacy" available

texts:
My setup is like this: multiple additional user fields (not using profile2) and the module "User Field Privacy" is enabled.

I am currently theming user profile pages through a preprocess function and the corresponding  user-profile.tpl.php… Now I have some fields that should be visible to some roles, but hidden to others. I trigger this through the module  "User Field Privacy". Looking for variables in the devel dump does not bring anything for "User Field Privacy" .

 [field_telefon] => Array
         (
           [und] => Array
              (
                [0] => Array
                   (
                     [value] => +01 234 567 890
                     [format] =>
                     [safe_value] => +01 234 567 890
                    )

               )

          )

When not theming through preprocess and .tpl, everything is fine – the fields marked hidden are actually hidden from regular and anonymous users, but shown to users with the appropriate permission.

How/where can I find the "marker" or "flag" for the User Field Privacy setting ?

Any pointers, hints and tips welcome!


texts: Can a form triggering an ajax call reload itself on drupal 7?

texts:
I'm trying to built a page to ask questions with a stream on top, so I need ajax to avoid the reload. It is actually simple. On top is a node with the stream and I add to blocks beneath.

A table with the questions, number of votes for the questions and an "add vote" button
A form to add a new node "question with 0 votes"

I have two problems.

A)When I click on the submit button of the 2. Block I add a question, I can update the table with the new question, but the add question form is not being emptied.

B)When I add a vote on the table (currently an ajax call from a checkbox) I get the database to have an increased counter and as far as I could check the callback delivers the new table, but the old one is never replaced. I thought it was the cache, but I even managed to avoid using the cached one, still no replacement. I get a few headers allready sent notices, but I don't understand why. I just want the form to be replaced by the new one.

(don't mind me getting a view instead of just a database result, it's just to built the table)

function questions_list_voting_form($form, &$form_state){
global $user;
$form['#prefix'] = '
';
$form['#suffix'] = '
';
$form['table'] = array(
        '#tree' => TRUE,
        '#theme' => 'table',
        '#header' => array(t("Title"),t("Votes"),t("Add vote")),
        );
    $view = views_get_view('questions_view');
}
$view->is_cacheable = FALSE;
$view->execute('block');
foreach ($view->result as $row){
    //['rows']['row-'.$row->nid]
    $question = array('#markup'=>$row->node_title);
    $vote = array('#markup'=>$row->field_data_field_votes_field_votes_value);
    $addvote = array(
    '#type'=>'checkbox',
        '#return_value' => 'add_vote'.$row->nid,
    '#ajax' => array(
      'callback' => 'ajax_addvote_callback',
      'wrapper' => 'question-list-table',
        'effect' => 'slide',
    ));
    $tab_arr = array(
            'question' => &$question,
            'vote' => &$vote,
            'addvote'.$row->nid => &$addvote
    );
    $tab_rows = array(
            array('data' => &$question),
            array('data' => &$vote),
            array('data' => &$addvote),
    );
            $form['table'][] = $tab_arr;
    $form['table']['#rows'][] = $tab_rows;
    $form['redirect'] = FALSE;
    $form['#rebuild'] =TRUE;
    unset($question);
    unset($vote);
    unset($addvote);
       }
     return $form;
}
function questions_list_voting_form_submitx($form, $form_state){
   if(substr($form_state['triggering_element']['#value'],0,8) == 'add_vote'){
    $tmp_node = node_load(substr($form_state['triggering_element']['#value'],8,2)); //question node
    $tmp_node->field_votes['und'][0]['value']++;
    node_save($tmp_node);
   }
}
function ajax_addvote_callback($form, &$form_state){
questions_list_voting_form_submitx($form, $form_state);
$form_state['no_redirect'] = TRUE; // avoid redirect?? maybe not working
$form_state['input'] = array('test'=>'etch'); //something to avoid cache
$form = drupal_build_form('questions_list_voting_form', $form_state);
$form_html = drupal_render($form);
return $form_html;
}


texts: Conditional class on  element a la boilerplate

texts:
This might be a totally mundane question, but I hope not.

I want to add conditional classes onto the <html> element of my theme like boilerplate. I'd like to keep things neat and not complicate my page.tpl.php.

<?php
  $htmlvar = 'xmlns="http://www.w3.org/1999/xhtml" xml:lang="' .
    $language->language . '" lang="' .
    $language->language . '" dir="'. $language->dir .'"';
?>

<!--[if lt IE 7 ]> <html class="ie6" <?php print $htmlvar ?>> <![endif]-->
<!--[if IE 7 ]>    <html class="ie7" <?php print $htmlvar ?>> <![endif]-->
<!--[if IE 8 ]>    <html class="ie8" <?php print $htmlvar ?>> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html <?php print $htmlvar ?>> <!--<![endif]-->

Reactions? Suggestions? Taunts?


texts: How to 'SELECT FROM {entity_bundle} WHERE field_A + field_B <= given_number_X' with EntityFieldQuery

texts:
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'MYCONTENTTYPE')

// Now say for instance I would like to grab the value of
// field_A and field_B, sum them up ( or subtract | divide | multiply them ).
// Then compare the result of that ( is greater than, equals to, smaller than )
// with a given number X. Is it possible with EntityFieldQuery?

$query_result = $query->execute();

I know I could do that by looping through the query result. Nontheless, if EntityFieldQuery allows me to do that at query time, I would like to know how.


texts: Change a Node Reference field value with VBO

texts:
I'm having trouble setting a Node Reference field using VBO. If I select Integer as the parameter type it doesn't change the field value, and if I set it to Node Reference it has a "Data selector *" field for the input and no value seems to satisfy it.

Any suggestions?


texts:
I'm using Omega's sub-theme creativpink. I put my site on web for testing purpose. Basically I want to customize page-user-reset page (user-pass-reset is form id). Now I click Request new password link enter my mail id to send password reset link. When I click on that link from my mail it redirects to page-user-reset page and it shows the following information:

Site Name

  Home

Reset password

This is a one-time login for username and will expire on Fri, 11/01/2013 - 20:41.
Click on this button to log in to the site and change your password.
This login can be used only once.
Login(button)

Powered by Drupal

Currently it includes header, breadcrum, content and footer regions. But I want only content region and the user password reset form inside content region. So I would like to write a template file based on this user-pass-reset form. Guide me what I want to do this? Thanks in advance.


texts: What's the difference between indexed and non-indexed field in Views and Search API?

texts:
I'm using Search API with a database backend and Views to build the search results page. More specifically, I'm using fields in Views. When selecting fields, I see two options for example:

Title
Title (indexed field)

When using this field, I get the same result. So I'm wondering why might I use the indexed version over the regular?


texts: When should I create a service for a class?

texts:
It seems that in Drupal code anything that is neither hook nor Plugin nor Controller nor any other thing with a standard functionality should be a Service.
For sure, services make sense when we want to give other modules the possibility to change the functionality that we are writing.
But I can think of a lot of scenarios where it is absolutely sufficient to have a normal class. When we just want to create an instance, call a method, nothing else.
How can I decide if a class is sufficient, or if a service makes sense?
Edit This is not opinion based. There must be a clear and objective reason why we use services in Drupal, and I want to know this reason.


texts: How do I add a column to the table shown in the vocabulary listing page?

texts: I need to add a column to the table shown in the page listing the vocabularies defined for a site. How can I achieve this?


texts: hook_node_update hitting a wall with a loop I created

texts:
I have a taxonomy multi-select list that is used to create/delete entries in a field collection in my node. I'm trying to make it so that if the user deselects an item from the taxonomy list, the corresponding field collection item is removed from the node. I'm running into an issue when the user deselects a single option because of the way my code runs but I can't figure out how to get around it:

I compare the selected options in my taxonomy list
I look for them in the field collection
If they don't match, I add the differences to two arrays
I loop through one array to remove the field collection item if it's not selected in the taxonomy list AND
I loop through the other array to add the field collection item if it's on the taxonomy list but not the field collections

With one option difference, my code seems to delete and add it back so there is no visible change. It works if I make multiple selection changes. I believe the issue is that ->delete() and ->save() save the node as well so my code runs more than it needs to.

function commitments_node_update($node) {

    if($node->type == 'commitment') {
        if (!empty($node->field_conditions['und'])) {
            $condition_name = array();
            $fc_name = array();
            //Create array of all FC conditions
            foreach ($node->field_conditions['und'] as $key => $value) {
                $fc = entity_load('field_collection_item', array($value['value']));
                foreach($fc as $condition) {
                    $fc_name[] = $condition->field_condition_title['und'][0]['value'];
                }
            }

            //Create array of all selected conditions
            foreach ($node->field_commitment_conditions['und'] as $conditions){
                $tid = $conditions['target_id'];
                $term = taxonomy_term_load($tid);
                $condition_name[$tid] = $term->name;

            }
            $fc_diffs = array_diff($fc_name, $condition_name);
            $condition_diffs = array_diff($condition_name, $fc_name);

            //Remove deselected conditions from FC
            foreach ($fc_diffs as $fc_diff) {
                foreach ($node->field_conditions['und'] as $item) {
                    $fc = entity_load_single('field_collection_item', $item['value']);
                        $fc_name_search = $fc->field_condition_title['und'][0]['value'];
                        if ($fc_diff == $fc_name_search) {
                            $fc->delete();
                        }
                }
            }

            //Add new conditions to FC
            foreach ($condition_diffs as $key => $value) {
                $term = taxonomy_term_load($key);
                $condition = $term->field_condition['und'][0]['value'];
                $condition_name = $term->name;

                $condition_fc = entity_create('field_collection_item', array('field_name' => 'field_conditions'));
                $condition_fc->setHostEntity('node', $node);
                $condition_fc->field_condition_title[LANGUAGE_NONE][0]['value'] = $condition_name;
                $condition_fc->field_condition[LANGUAGE_NONE][0]['value'] = $condition;
                $condition_fc->save();
            }

        }
    }
}


texts: Menu block makes parent menu item active when maximum levels not cover the linked node

texts:
In Drupal 7, a menu block can specify maximum levels.
If the maximum levels is not enough to cover all menu items linked node, when in the
not-covered menu items linked node, could menu be active at their parent menu item?

For example,  a menu has 3 levels, and specify maximum levels = 2, when at level 3 menu
item linked node, could open its parent menu item in level 2?

Have a menu like this:
M1
 M11
  M111
  M112 - link node PageM112
 M12
  M121
M2

If maximum levels = unlimites
At PageM112 node page, the menu will be like this.
M1
 M11
  M111
  M112 - linking to PageM112
 M12
M2

If maximum levels = 2, going to PageM112 node page, the menu will closed, like this.
M1
M2
M3

In this situation, could the menu be active at its parent menu item, M11, with the menu
expanded like this?
M1
 M11 - active
 M12
M2


texts: Do I have to use Views to use all the behaviors of OpenLayers maps module?

texts:
I just started using the http://drupal.org/project/openlayers module. There are plenty of tutorials to learn about it, but all of them make use of views to show the maps.

I need to show a simple map to show a single the location. I need this map to show a marker and a tooltip with some information (address, phone,...)

I tried showing a map in a node by adding the geofield field to a content type and then setting the OpenLayers Map Widget in manage display.

The map is shown up fine but as far as I see there no way to add a popup to the map.

Then my question is: Do I need to show the maps through a view to get all the behaviors provided by the module?


texts: Problem updating node module from drupal 6 to drupal 7

texts:
I am trying to update my drupal version from 6 to 7. I have a problem, I use the next link http://localhost/drupal6/update.php and when the process said "Updating node module" it never finish.

I use WAMPSERVER in WINDOWS 8.1


texts: Taxonomy Term Reference Fields Don't Get Created on Nodes During Migration

texts:
I have followed the steps shown here to create/run the migration.  Everything seems to migrate correctly except the Taxonomy Term Reference fields never get added to the nodes.  The taxonomies and vocabularies do get created.

I'm thinking that those fields should have been created in d6_field_instance so here is my migrate_plus.migration.upgrade_d6_field_instance.yml.

uuid: 6e1fd6ac-1ec4-4631-93d1-753068fdc667
langcode: en
status: true
dependencies: {  }
id: upgrade_d6_field_instance
migration_tags:
  - 'Drupal 6'
migration_group: migrate_drupal_6
label: 'Field instance configuration'
source:
  plugin: d6_field_instance
  constants:
    entity_type: node
process:
  field_type_exists:
    -
      plugin: migration
      migration: upgrade_d6_field
      source:
        - field_name
    -
      plugin: extract
      index:
        - 1
    -
      plugin: skip_on_empty
      method: row
  entity_type: constants/entity_type
  field_name: field_name
  bundle:
    -
      plugin: migration
      migration: upgrade_d6_node_type
      source: type_name
    -
      plugin: skip_on_empty
      method: row
  label: label
  description: description
  required: required
  status: active
  settings:
    plugin: d6_field_field_settings
    source:
      - widget_type
      - widget_settings
      - global_settings
  default_value_callback: ''
  default_value:
    plugin: d6_field_instance_defaults
    source:
      - widget_type
      - widget_settings
destination:
  plugin: 'entity:field_config'
migration_dependencies:
  required:
    - upgrade_d6_node_type
    - upgrade_d6_field
  optional:
    - upgrade_d6_field
    - upgrade_d6_node_type

Any idea what it can point me where in code to look.


texts:
Is it possible to automatically add a class to each <ul> element added to the CKEditor WYSIWYG?

In my project, I decided to not style ul > li in order to not have to rewrite CSS for each ul Drupal can display (i.e. menus or contextual links). So, I have only one CSS rule for my unordered lists: ul.my_custom_class li. I used to add a custom style in CKEditor's Styles dropdown that add this class, but it's not a perfect solution, as some administrators forget to use it (or sometimes, CKEditor does not recognize ul ou a since Drupal 8.4.x, see this thread).

The perfect solution would be that, each time you add an unordered list into the WYSIWYG, instead of having ul li, you'd have ul.my_custom_class li. I know I can use an other CSS rules like .ckeditor ul to make it work, but I want to be able to use this specific class anywhere in the website.

I've found some methods in the CKEditor docs but I don't really know where to use them on Drupal 8.


texts:
I'm building with D7 and looking for an easy way to build a page rendered into an overlay.

Wouldn't it be awesome if Panels could be configured to spit out it's contents into an overlay -perhaps the core admin overlay.

Has anyone seen anything like this? Is it worth building?


texts: How to get the distinct number of the nodes?

texts:
In my task I need to get the distinct number of the nodes of some content type. How can I do it?

$query = $this->connection->select('node', 'node')->condition('node.type', $type);
$query->addExpression('COUNT(*)');
$query->innerJoin('taxonomy_index', $id,  "$id.nid = node.nid  AND $id.status = 1");
$count = intval($query->execute()->fetchField());

As the node may have multiple values for the field, in the end it counts all nodes and produces the wrong output. Therefore I need to get distinct number of nodes.

Just adding $query->distinct(); doesn't bring anything. Could you please help me how can I solve the issue?


texts: Remove the strict warnings from being shown

texts:
I have a site using Drupal 6; after upgrading PHP to 5.4 , some strict warning appear.

I set error_reporoting in settings.php with the following code, but I still see the E_STRICT warnings.

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
ini_set('display_errors', TRUE);

Why do I still see them? What can I do to avoid seeing them?


texts: How to hide completed event from view result based on it's end date?

texts: I have created an Event Type pages which have date field Start Date-End Date, how do I hide completed event in view result or else is there any other way to unpublished them automatically?


texts: How can I stop Drupal from tracking or collecting IP addresses?

texts:
Is there a way to stop Drupal from tracking or collecting IP addresses of visitors? The specific need case is for a site that wishes to be able to say no identifying information is kept of visitors (it sounds seedier than it actually is).

I recognize that Apache logs are going to do this, and that will need to be handled separately, but I'm wondering if there's any way to prevent this in Drupal (or if you have suggestions on how to obfuscate incoming visitor IPs, that would be helpful as well)


texts:
So I feel like I must be missing something obvious, but I can't find a solution to my situation. I'm trying to sort some nodes by the chosen taxonomy term name. This is Drupal 7, Views 3.

I have a taxonomy vocabulary 'Country' that is setup something like:

Asia
--Bangladesh
--India
--Vietnam
Afria
--Algeria
--Libya
--Nigeria

On the content type ('Partners') I have a taxonomy field called field_country. I happen to be using the Hierarchical Select module to make sure that, for this field, only the deepest levels are chosen (countries, not regions).

So all of that works and I can display the country chosen as a field in the view.

But I can't seem to figure out the correct way to sort by that country name. When I add the field_country field to the sort criteria, the ordering doesn't make sense. When I check the SQL statement it actually shows that it is sorting by field_data_field_country_field_country_tid. So it seems to be sorting by the tid rather than the actual term value. Although, a quick scan of the tid values shows that it isn't even sorting correctly by tid!

Here is what the SQL looks like:

SELECT DISTINCT node.nid AS nid, node.title AS node_title, field_data_field_country.field_country_tid AS field_data_field_country_field_country_tid, 'node' AS field_data_field_location_node_entity_type, 'node' AS field_data_field_country_node_entity_type, 'partners:block' AS view_name
FROM
{node} node
LEFT JOIN {field_data_field_country} field_data_field_country ON node.nid = field_data_field_country.entity_id AND (field_data_field_country.entity_type = 'node' AND field_data_field_country.deleted = '0')
WHERE (( (node.status = 1 OR (node.uid = 1 AND 1  0 AND 1 = 1) OR 1 = 1) AND (node.type IN  ('partner')) ))
ORDER BY field_data_field_country_field_country_tid ASC
LIMIT 9 OFFSET 0

Any suggestions? Is there a magical relationship I have to activate to get the correct sort option available?

Thanks!


texts: Customizing views output- rewrite output to show an image based on key value

texts:
I want to use a views template to customize the output of the gender field on my user profile.  The gender field is a select list, and the key values are as follows:

f (female)
m (male)
o (other)

I created a template file, views-view-field--field-acc-gender.tpl.php.  I have the images saved in my theme's directory.  I can write an if statement to check against the key value, but how do I get the value of the field?  (This is probably a straightforward question, but I just learned about views templates today.)

I tried the following in views-view-field--field-acc-gender.tpl.php:

<?php
if ($output == 'M') {
  print 'male';
}
else if ($output == 'F') {
  print 'female';
}
else {
  print 'other';
}

However, my view still simply prints out M or F instead of male or female.


texts: URL to catch post data from off-site payment gateway in Drupal commerce

texts:
We have to set up an Drupal 7 e-commerce site with Commerce module (Kickstart) that accepts payments via an off-site payment gateway. For which we are developing a commerce payment method that will accept payments from the payment gateway.

Now, We are stuck at this step where this page is shown to a user:

example.com/store/checkout/[transaction id]/review

After selecting the payment method (that we developed) on the above review page, the page redirects to the payment gateway site.
The Payment gateway site, after a payment attempt, sends the payment status to a response page via POST method.

Now, we don't know where to 'catch' the post data sent by the payment gateway in the payment method module.

Also, after the POST data is processed, how to update the order/transaction status in the database and show success/failure message to the user.

Any help would be appreciated.


texts: How to get a machine name of a custom block

texts:
I have a custom "Slider Items" field type, as well as the custom "Channel Slider Block Type" type block (created using "Custom block library").

Also, I have several "Channel Slider Block Type" blocks.  I need to somehow determine the machine name of a block that this field displays in @FieldFormatter of my field. How can this be implemented? Perhaps there is a special service for this?

/**
 * @FieldFormatter(
 *   id = "channel_slider_formatter",
 *   label = @Translation("Channel Slider Formatter"),
 *   field_types = {
 *     "channel_slider"
 *   }
 * )
 */
class ChannelSliderFormatter extends FormatterBase {

  public function viewElements(FieldItemListInterface $items, $langcode) {
    // Here I need to get a block that reflects this field.
    $blockMachineName = '...';
    ...
    return [
      '#theme' => 'channel_slider',
      '#items' => $itemsData,
    ];
  }

}


texts: Programmatically import users and create each for them organic groups

texts:
I have a function that allows me to create users from the data of an external database:

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

    // Use external database.
    db_set_active('external_database');
    // …
  }

Now I want to create, for each user from the external database, two groups (each group with four Drupal users, a group administrator, and three normal members).
I can create a group with og_insert_group($node);.
I can also create an admin for this group with og_save_subscription($node->nest, $node->uid, array ('is_active' => 1, 'is_admin' => 1));.

I don't know how to create multiple groups, and add members to these groups.
I also do not know where to put the code to create groups in the LoginUser module, or in another module.


texts: How can I upload a CSV file and expose it in a "views table" for Drupal 7?

texts:
I am looking to create a simple table with 3 fields (columns) but at least 25 rows of possible entries.  Then I want to display this in a views table (with pagers etc.)  -  I have done this by creating a content type with 3 custom fields, then filling out 25 of these custom content types (nodes) - then exposing all 25 nodes in a views table to get these results.  However- there should be a simpler way to simply upload a CSV table that is already formatted (in Excel or Spreadsheet or text file) in rows and columns and simply use views to display the data in a simple table.

This would greatly reduce the amount of unnecessary published content as well as the workload to create a simple, searchable table from views.

Any other ways to make this work without hacking into the Drupal Database?


texts:
I want to override field_multiple_value_form function not the theme_field_multiple_value_form function.

How will I do this. I want to execute my own custom function instead of executing field_multiple_value_form function.


texts: 'EntityMalformedException' after modifying '$form_state['values']'

texts:
I have to replace some Arabic characters with Persian ones. I used hook_form_alter() and added my form submission callback as first one.

farsichar_form_alter(&$form, &$form_state, $form_id) {
  array_unshift($form['#submit'], 'farsichar_custom_submission');
}

function farsichar_custom_submission($form, &$form_state) {
  farsichar_replace($form_state['values']);
}

farschar_replace() is a recursive function which crawls in $form_state['values'] and replaces the characters.

function farsichar_replace(&$value) {
  // $arabchar is an array of characters which I like to replace.
  // $farsichar is an array of substitutions.

  if (is_array($value) && empty($value)) {
    return;
  }
  if (!is_array($value)) {
    $value = str_replace($arabchar, $farsichar, $value);
    return;
  }

  $keys = array_keys($value);

  foreach ($keys as $key) {
    $value[$key] = farsichar_replace($value[$key]);
  }
}

I get this error message every time I submit the form:

  EntityMalformedException: Missing bundle property on entity of type node in entity_extract_ids() (line 7501 of includes/common.inc).

Where's this problem come from?


texts: Is there still a hook_nodeapi in drupal 7 or do i have to try hook_node_load hook for appending some content to node?


texts: Possible to join different entity type on using EntityFieldQuery?

texts: I am wondering whether I can use EntityFieldQuery to fetch all entities belonging to a specific content type. This entity type has a reference to another entity type. Is it possible to check against the refereed entities fields in the same query?


texts:
I am new to drupal, so this issue may be something extremely basic that I am missing.

Basically, I have 2 views. A parent and a child. There are 3 content types. Industries, Applications and Minerals.

I need the parent view to show all industries, then the child view should show the applications within each industry, which are linked using an Entity Reference field.

Can someone please point me in the right direction on how to pass a contextual filter from the parent view to the child view. Basically i need to filter the child view on the title field of the parent view.

FIXED

Used NID instead of Title!


texts: file_exists with 'replace' or 'use existing' not working when a variable is passed

texts:
Can somebody point out the fault in this snippet for downloading a file entity. I am trying to replace or use existing file dynamically using migrate_plus. When I give a variable it doesn't seems to pass to 'download' plugin. If I hard code the value to 'replace' or 'use existing' it works.

file_config_keys:
  plugin: default_value
  default_value: "use existing"
uri:
  plugin: download
  source:
    - '@source_image_url'
    - '@dest_image_uri'
  file_exists: '@file_config_keys'
destination:
  plugin: 'entity:file'
migration_dependencies: null


texts: Changing values in preprocess view function

texts:
I want to preprocess view to alter a field based on another field. I am able to print the value but not change it.

I did this:

function MYTHEME_preprocess_views_view__VIEWNAME(&$vars){

     kpr($vars['view']->result['0']->field_field_name[0]['rendered']['#markup']);
}

Which prints the correct value.
But when I try to change/unset the value it does not work. Both of these do not work.

 unset($vars['view']->result['0']->field_field_name[0]['rendered']['#markup']);

 $vars['view']->result['0']->field_field_name[0]['rendered']['#markup'] = '';

I also tried another way  which prints the value but does not change it:

 unset($vars['view']->result['0']->_field_data['nid']['entity']->field_name['und'][0]['value']);

Note: I am rewriting the results of a field with view UI.


texts: How to restrict time values in YAML Form timepicker?

texts:
If I use the time element in YAML Form then I get the options starting from 00:00 and steps of 30 minutes.

Is there a way to restrict the valid options starting from 10:00 to 18:00 and set the steps to 15 minutes?


texts: How to enable Submit Button after filling out the required fields?

texts:
I have created custom Content Type and I would like to disable the submit button, till the user has filled out all the required fields.

I should enable the submit button, once the user fills out the required fields, how do i achieve this?


texts: What does the 'master' option in the attachment view settings stand for?

texts:
I am using some attachment views to display the latest one of different content types in one view.

I was using the first (block) view as the parent view and was attaching the others to this view. This, in many cases ok. But now I ran into some styling issues, caused by the overly complicated markup.

So I decided to delete the block view, convert all the views to attachments and  of the view attachments, and attach all of them to 'master'. I was hoping this would give me a homogeneous markup.

But now the block disappeared completely. It is not even visible in the blocks admin page.

So my question is, what does the 'master' in the attachment options stand for?


texts:
I'm trying to make an events calendar that has events on a day, (e.g. Feb 2), with a start and end time, (1pm - 3pm).

However, the current date module in Drupal 8 doesn't have support for end times and the date module doesn't seem to be ready yet.

How would I such a date field up? I could always use a textbox, but I need to be able to set different date formats for the day of this field.

I see that there isn't a well known option for drupal 7, but hopefully there is a elegant solution for Drupal 8. Worst comes to worst, I'll accept hacky solutions....

Thanks!


texts: Check required directory structure on module install/enable

texts:
I am working on a drupal 7 module which acts as a interface for real estates. The interface works with xml files. Because of this i need some folder in the private files system.

I have defined my required folders as constants in the .module file. Now i wanted test with file_prepare_directory if the folders exist and if not create them. I want to do this on module install (hook_requirements) because the module works in the background with crons, so i would never get an error message if there is something wrong with the folder structure. The problem is that i could not access the constants from the .module file in the hook_requirements function.

So what is the best way to do this in drupal 7? Should i use hook_requirements, and if yes, how could i get my constants working? Or is there an ever better way to do this?


texts:
Looking for a module or hint to allow a node only be accessed from the manually set URL.

Ex. having node 42 with  URL path setting = myStory can only be accesed with http://host/myStory, while http://host/node/42 will return a NOT FOUND.


texts: How to set Views aggregation to group by just one field?

texts:
I would like to achieve something like this with Views.
select o.id, o.title, o.date, sum(o.price) as total from orders o group by o.id, title;
However, when I choose to use aggregation on this display the SQL will become grouping by all the fields that I selected, like:
select o.id, o.title, o.date, sum(o.price) as total from orders o group by  o.id, o.title, o.date;
I don't see a "Do not use aggregation for this field" setting on Aggregation type settings form.
Can I achieve this without query_alter hooks?
update
It turns out that my desired SQL is only valid in MySQL, and not in SQL standard, so I just cannot achieve this via Views.


texts: Alter views 'Has taxonomy term' filter Programatically using views_get_view

texts:
Im am having some problems setting TID filter values programatically. I have an array of term ids form a taxonomy field that I need apply to a views filter via views_get_view.

This is the code that I have within a DS field that Im trying to alter via the view's display_handler - Im not even sure if this is the best way to do this. Hopefully someone can explain how this can be done.

Any help would be much appreciated.
Thanks

    $pager_count = field_get_items('node', $fields['entity'], 'field_pager_count');
    $pager_count = isset($pager_count[0]['value']) ? $pager_count[0]['value'] : 10;
    $node_tags = field_get_items('node', $fields['entity'], 'field_tags');
    $current_node = (arg(0) === 'node' && is_numeric(arg(1))) ? arg(1) : '';
    $tags = array();

    // Alter view to set TID filter and pager
    $view = views_get_view('list_control');
    $view->set_display('block_1');
    $view->set_arguments(array($current_node)); // Remove current NID
    $view->set_items_per_page($pager_count); // Set pager Items
    $view->pre_execute();
    $view->execute();

    foreach($node_tags as  $node_tag) {
      $tags[] = $node_tag['tid'];
    }
    //Set filter values base on $tags array
    $filters = $view->display_handler->get_option('filters');
    $filters['tid']['value'] = $tags;

    // Return DS field.
    $field =  $view->render();


texts: Using original picture after preprocess function

texts:
I have a preprocess function (function MYTHEME_preprocess_user_picture()) that scales and crops user pictures throughout the site and they become the default pictures.

How can I still have access to the original picture (non-cropped, non-scaled) for use in some parts of the site (Views for example)?  The "original" option in the views image select list has disappeared.

I am trying to avoid using image styles as the creation of different image styles slows down the site and takes room on the server (social networking site with many users.) Besides, using image styles also require a page refresh to see the pictures once uploaded. The preprocess function solves all these problems.

Any and all help is appreciated.

Thank you. :)


texts: Dynamic menu item based on Views argument

texts: Is it possible to have a dynamic title on the menu item based on the argument that Views is receiving? I'm using the title on the menu item on the breadcrumb and my breadcrumb changes based on the argument.


texts:
I have a function:

  jQuery(function($){
    $(document).ready(function(){
      $('.Testimonials').each(function(){
        var theContent = $(this).html();
        theContent = '-' + theContent;
        });
    }); // END doc ready
  }); // END function

Basically I wanted to add a text before an option (unable to do it by css). What am I doing wrong?

I tried like this as well:

$('.Testimonials').insertBefore($(this).html(), $('text'))

but it doesn't work either.


texts: Behat @javascript test can not login user - incorrect username or password message

texts:
I am running:

Drupal 7
Behat 3.5.0
Selenium 3.5.0
Chrome Driver 73.x

Using this test:

Feature: User Profile

Background:
  Given users:
    | name | status | roles |
    | incomplete | 1 | authenticated user |
    | complete | 1   | authenticated user |

  Given profiles:
    | drupal_username | field_profile_completed:value | field_first_name | field_last_name | field_birth_month | field_birth_day | field_degree | field_profession | field_specialty | field_organization | field_department |
    | incomplete | 0                                  | |  |  |  |  |  |  |  |  |
    | complete   | 1                                  | John | Doe | 08 | 03 | APRN | 15 | Anesthesiology | MyOrganization | MyDepartment |

@api
@noEncrypt
@defaultRegistration
@javascript
Scenario: As a user with an incomplete profile I should NOT see an icon indicating my profile is not complete.
  Given I am logged in as complete
  Then I should not see an ".js--user-profile-incomplete" element

@api
@noEncrypt
@defaultRegistration
@javascript
Scenario: As a user with an incomplete profile I should see an icon indicating my profile is not complete.
  Given I am on "/user/login"
  And I fill in the following:
    | name | incomplete|
    | pass | password |
  And press "edit-submit"
  Then I should be on "/"
  Then I should see an ".js--user-profile-incomplete" element
  When I wait for ".profile-notify__incomplete"
  Then I should see an ".profile-notify__exclamation" element

As you can see, I've tried  logging in using Given I am logged in as and tried logging in via a meta-step.  I can watch it in the browser and I'm getting an "Unrecognized username or password" error.

Login works fine without @javascript but I can't test the "When I wait" functionality.  If I use a break I can see that the users are created in the database.

Why are my @javascript tests not able to login?


texts: Is there any way to use a jQuery overlay to confirm/reject node deletion?

texts:
When I delete a node (any type of node, presumably), I'd like to have the confirmation happen through a jQuery-like yes/no dialog popping up over the page, rather than being redirected to a separate page with the "This action cannot be undone" message.  This being the 21st century and all...

http://bootboxjs.com/ would seem to be a good candidate for handling the dialogs, but the question is how to tie it into the form and node deletion processes, ideally without hacking core and/or patching everything in site.  Has anybody thought this through?


texts: Only render translated nodes, prevent rendering of base language node

texts:
Having an entity reference, Drupal 8 automatically renders the base language of a referenced entity if it isn't translated yet. Is there a way to globally prevent that? So if there is ContentType1 referencing ContentType2, both have a default language of en-gb. Translating ContentType1 to de-de will by default still show ContentType2's en-gb node unless I manually translate it or change a thing.

What I currently do is comparing the current page language \Drupal::languageManager()->getCurrentLanguage()->getId(); with the current node language $variables['node']->language()->getId(); and return an empty node.html.twig.

Is there a better solution? Especially when you have multiple node.twig.html


texts: Adding an existing file to the File records

texts: I have a unique situation where earlier in the day, a file is uploaded to the Drupal files directory for my site (through an outside service, such as SCP), and I need to index it inside the CMS so I can interface with it through the File API. What's the best approach to do this?


texts: Insert some data in comment upon comment submit

texts:
For some reason I cannot find answer to relatively simple question. How to insert some data (for example the "title" filed value) into comment body upon the comment submit. Finally I'd like to have in comment body something like this:

Node title (with some CSS markup) -
Comment body -

Could you please advice the right way to do this?


texts: How to add the js files to specfic modules only

texts:
I am having a module and am adding the js files which is using on the top of the module file as follows :

drupal_add_js(drupal_get_path("module", "notification") . "/js/jquery.js");

But the problem is this js file appear in the whole site and makes things messy . I need this file should appear in the notification module only. Another problem is the by default D6 using the jquery.js (which is an older version 1.2.1) and  by default its taking from the sites/misc path .its taking the old $.browser function and all !! .  And when am including the latest version it makes conflict with the oldest version  . How to solve this ?


texts:
I have custom module, where after form_submit, i do some calculations, and get result of those calculations in a variable.

After i hit "submit", i can output those calculations with drupal_set_message , but i would like to format results (array), and print it bellow the submit button. How can i output resulting variable bellow the form or in the form, after submission ?

function mymodule_form_submit($form, &$form_state) {

$a=$b+$c;

// on submit, i would like to print/format $a on the reloaded form page

}

Thanks!


texts:
Do anyone know how to remove the 'Please Wait' pop up from the filedepot interface? I've searched through the files and can't find it

from Filedepot?


texts:
How can I limit submissions within a period of time?

I am moving from webforms to entity forms and need to limit the number of submissions a user can make within a given time. I want to restrict access to form based on this. This would be only apply to anonymous users.

List item

1 Submission per week
3 submission per day
etc. Similar to the setting on webforms


texts: How to set body field display programmatically on node type install?

texts:
When hook_installing a new custom node type filled with custom fields I call field_create_instance($instance) where I also set the custom fields' display like so:

'display' => array(
  'default' => array( // view mode
    'label' => 'hidden',
    'type' => 'text_default'
  ),
  'teaser' => array( // view mode
    'label' => 'hidden',
    'type' => 'hidden'
  )
)

I also added a body field via node_add_body_field($type) but where can I set that body's display properties programmatically? Per default it's set to be displayed in the teaser view. I want to hide it.


texts: How to support .dcm image format file for uploading in an article?

texts:
I want to upload .dcm image format file into Drupal7 article, but it's not allowed.

Suggestions about how to get this to work?


texts:
I have created a content type, with a custom field.

Then i have created an Entity Rereference on the users fields, so the user can select from those nodes on their user account settings.

The idea is to allow the user select values from a content type, this is working, but i need to show this field with the selected values on a custom module with php.

I got already the user object but not able to get the nodes selected from the entity:

$id is the current user id, this is ok!

$user = User::load($uid);

Trying to getting the values:

$selectedBrands = [];
foreach ($user->field_brands as $item) {
  if ($item->entity) {
    $selectedBrands[$item->entity->id()] = $item->entity->label();
  }
}

Im just getting this:

Array()

But the user has 2 selected brands here.


texts:
I am using Drupal 7. I have used Views Bulk Operations (VBO) module  to send an email, which is working fine.
Now Problem is that email is going as TO , all other user are able to see other emails id.

I want to send as Blind carbon copy (bcc). Can anybody tell, how we can do this?

Thanks


texts:
Scenario:

We have a bunch of events, each event has a date field, and a separate time field that has a start and end value. I'm trying to build a module pulls in the next event that hasn't ended yet. Also, if there are more than one events on that day, we need to pull all of them.

My main problem is figuring out how to construct the values that I need to query that time field with, it seems to be stored is a format that I'm not familiar with, e.g. the value 4:30PM is stored as 59400. I can't find any documentation that specifies how to convert that value back and forth.

Any Drupal gurus / php gurus out there know what that conversion is?

Thanks, Neil


texts:
I want to create a list of dates in a CCK select list with PHP arrays.

I don't have any luck with this, any help is appreciated.

Minimum date: +4 days
Maximum date: +2 months
Only bussines days (Mon-Fri)

And I also would like to display the dates in the following format: "Mon 5 Nov."

Thanks.


texts: How to set up a text format that replaces the tokens?

texts:
In the custom Drupal 8 block, there are no tokens.

/admin/structure/block/block-content

How to set up a text format that replaces the tokens ?

I need to use in a custom block, the title of the current page, the creation date of the current page, ...


texts:
I have a form which has a select with a #default_value which get's set when the user has errors/has filled out the form. Then I have two fields with a #states that show them when the select has a value.

So basically

$checkout_form['wrap'] = array(
  '#type' => 'select',
  '#title' => t('How many item(s) do you wish to have wrapped?'),
  '#default_value' => $default_giftwrap_amount,
);

Then I have a fieldset and a textarea with

  '#states' => array(
    'visible' => array(
      ':input[name="wrapping[wrap]"]' => array('!value' => ''),
    ),
  ),

which make those two fields show when ever something is selected.

But my problem is when the #default_value is say 400 (ie something is selected) it doesn't show the fieldset and textarea, only when you select something.

Is there anyway for it to check on page load as well as onchange?


texts: Drupal not responding after moving to remote host

texts:
I'm recently trying to lunch a new website using drupal 8.1.0 and I'm working on it more than 2 months now.I'm developing it on my local windows machine using Acquia Dev Desktop 2. Everything was working alright until last week, when i decided to move my website to the server and production environment; so I went through these steps respectively to move my website to the server :

1- First, i made a zip copy from my local drupal installation folder.
2- Uploaded and unzipped it under my web host root folder ( in my case, pubic HTML folder ).
3- Then from my local phpMyAdmin page, i exported a zip copy of my database.
4- After that in my server, I made a new database and a new user with all the privileges and connected them together.
5- Then I imported my local copy of database to the server using phpMyAdmin.
6- Then in my drupal's settings.php file, I entered the information about my newly created database.

When i open my website in a browser, everything works fine and all the links are accessible. But there is an strange problem. After going to any page on my website and after loading the page is complete, the whole website stop's responding and freezes! it's some sort of hanging that i can't do anything and i can't click on any link. Most of the times, it takes more than 5 minutes to come back to working again and sometimes, it doesn't come back. Only after I refresh the page and browser starts to reload the page, i can work with my site and after that loading is complete, it stops again.

The other strange thing that I've noticed is that this problem only occurs for the administrator and all the users who can see the drupal's admin toolbar. For the anonymous users, site works perfectly. Also I have another type of users on my website who are authenticated users, but they can't see drupal's admin toolbar. ( I've made them another customized toolbar to do their works ) and they have no problem as well. The other thing is that this problem doesn't happen on administrating pages which use "Adminimal theme". The website itself uses "bootstrap_business" theme for drupal 8. I've checked drupal's log messages and browser developer tools console, but I didn't find any related errors!

So in short, my website stops responding on pages which drupal's admin toolbar is shown and it's not using administration theme. Also i should mention that in my development local server, I use Mysql database, but in my web host, it's mariaDB.

Here is my website address

I need to lunch this website as soon as possible but with this issue, i can't do that. so,any help is greatly appreciated, Thanks in advance.


texts:
I've created my own module in drupal 8. I also created block in my module.
I tryied to add my custom block (which is type of custom form) to view. But when I am trying to add custom block in view, its not appearing in the list. Block is only appearing in block layout. What is wrong or is there other way of adding custom block from module to your view in drupal 8?

<?php
/**
 * @file
 * Contains \Drupal\reviewhelper\Plugin\Block\ReviewHelperBlock.
 */
namespace Drupal\reviewhelper\Plugin\Block;

use Drupal\reviewhelper\Form;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Provides a 'ReviewHelper' Block
 *
 * @Block(
 *   id = "ReviewHelper",
 *   admin_label = @Translation("Review helper block"),
 *   category = @Translation("Custom Blocks"),
 * )
 */
class ReviewHelperBlock extends BlockBase {
  /**
   * {@inheritdoc}
   */
  public function build() {
    $form = \Drupal::formBuilder()->getForm('Drupal\reviewhelper\Form\ReviewHelperPush');
    return $form;
  }
}


texts: "A" at start of node title causes it to not be found w search_api_solr unless "a" added to search string

texts:
I'm having a weird issue with string grouping, I was wondering if anyone might have suggestions on what to look at.

I'm maintaining a site that has a nodes indexed at HostedApacheSolr. We're using search_api and search_api_solr for the index, and the results are being displayed using Views.

One of the nodes has a title e.g. "A Banana in the Tree eBook" and there are several other nodes which mention "a banana in the tree" in their body text. Searching for different strings return different results sets in an unusual way:

"A Banana in the Tree eBook" (with quotes) - returns correct results.
"A Banana in the Tree" (with quotes) - returns correct results.
"Banana in the Tree" (with quotes) - returns no results.
Banana in the Tree (without quotes) - returns correct results.

Anyone have any thoughts on why adding the single word "a" before "banana in the tree" would give correct results, but without the "a" it gives no results at all?


texts: In node add, how to upload file using image from clipboard

texts: How can I paste image from clipboard and save into image_field ?


texts: Taxonomy translation Localize option not working correctly. thoughts?

texts:
I have a multilingual drupal 7 site. I have a series of taxonomy terms to choose from. I have the il8n Translate Taxonomy enabled and using it.

For my taxonomy I have selected "Localize. Terms are common for all languages, but their name and description may be localized."

However, despite being able to use the translate interface to correctly translate them, the terms still show up in English, the default language, regardless of what language I am viewing the content in. Here are links to the issues. Please see the tables.

http://tourismbuilder1.hokkaido-select.com/content/dai-ichi-takimotokan

http://tourismbuilder1.hokkaido-select.com/ja/content/%E7%AC%AC%E4%B8%80%E6%BB%9D%E6%9C%AC%E9%A4%A8

Thoughts as to why?

EDIT:
I found this link to the issue, which is unresolved.
drupal.org/node/1070256


texts: override views-view-fields.tpl.php in custom module

texts: Hi i want to Override views-view-fields.tpl.php in our custom module. kindly help me by example.


texts: Is it possible to host private files on remote file server in Drupal 8?

texts:
I want to know, In drupal 8, is there any way to host all private files on remote file server separated from host server.
Files must be uploaded or removed from remote server directly from Drupal site.
Is it possible?


texts: Are there any known compatibility issues between Bootstrap theme and Panels Bootstrap Layouts module?

texts:
Officially, the Drupal Bootstrap theme includes Panels in a list of modules not officially supported.

There's a module, Panels Bootstrap Layout, which claims to work with and recommends the Drupal Boostrap theme (as opposed to just hand-rolling Bootstrap). Its 7 branch is actively maintained but hasn't had a full release for a year or two.

Are there any compatibility issues between the two? In the module's issue queue, I found a post from one user in Jan 2016 saying they personally hadn't had any problems, but nothing more than this one post.

  The bootstrap maintainers warn that there may be incompatibility with this module. Although the bootstrap theme is recommended. It would be great if this were considered among the "supported" modules or specific caveats were identified. I've not found any specific issues ...

I've tried looking for open (or, fixed but not committed to stable) issues in both issue queues, not found anything but that doesn't mean there isn't anything.


texts: Where in The Database does File Usage Data Come From

texts:
How does data in file/[id]/usage get compiled?

From what tables does it determine a use?

Is there a way to track down how/where it gets this data and troubleshoot?
Does it take include revision data?


texts: How to show organic groups users that their subscription is pending?

texts:
I'm using the Organic groups (=OG) module. When a user subscribes to an OG they just see "Unsubscribe from group", even if they are not yet members, but their membership is pending. What is the best way to display a message such as "Thanks for your subscription request, it is currently being considered." or something like that?

Note: I have quite a number of questions related to Organic Groups but this is the best place I have found or support. If you can suggest other sources of OG support I would be very grateful!


texts: How to show tooltips on form labels based on view filter descriptions in a Bootstrap sub-theme?

texts:
I am trying to find a way to display tooltips when a user hovers the mouse over a filter label of a views search page. Preferably, to reduce hard-coding, I would like to take into advantage the filter description and get the tooltip text from there (and subsequently hide descriptions through css).

Also the best way I found to actually activate the tooltips in Bootstrap is to add the attribute data-toggle="tooltip" to the element that we need to show a tooltip for.

So far I am using the recipe from here adding the data-toggle element

 function mytheme_form_element($variables){
     dpm($variables);
  $original = theme_form_element($variables);
  $return = '
' . $original . '
';
  return $return;
 }

but I don't see the filter description anywhere in the $variables array plus this snippet themes the filter field and not the label but would probably do the trick.


texts: Content type errors - "The Byline text" error

texts:
I'm having trouble creating a content type. I can't seem to figure out to fix these validation errors. I'm not user what they mean.

The Byline text - Full content view mode is using the following invalid tokens: [node:author], [node:created].
The Byline text - Teaser view mode is using the following invalid tokens: [node:author], [node:created].
The Byline text - RSS view mode is using the following invalid tokens: [node:author], [node:created].
The Byline text - Search index view mode is using the following invalid tokens: [node:author], [node:created].
The Byline text - Search result highlighting input view mode is using the following invalid tokens: [node:author], [node:created].
The Byline text - Colorbox view mode is using the following invalid tokens: [node:author], [node:created].
The Byline text - Revision comparison view mode is using the following invalid tokens: [node:author], [node:created].
The Byline text - Tokens view mode is using the following invalid tokens: [node:author], [node:created].


texts: Cache remains stale for custom blocks after editing

texts:
My Drupal 8 website consists of multiple custom blocks created from the drupal backend user interface.

As I went from dev to production settings and activating Internal Dynamic Page Cache (set to 1 minute), the custom block content doesn't change on the actual site after editing (for both anonymous and authenticated users). If I go back to editing mode, the changes are persisted as expected.

The changes are visible when I clear the caches (i.e. drush cache-rebuild). I don't have any issues with my own blocks that implements the Block plugin and has a max-age set. Nodes works works as expected too.

What could be wrong?


texts: (solved) Display all Entityform submission to visitors

texts:
I build up a form using Entityform.
Finally I want that every visitor (registered or not) can see trough all submissions. How can i do that? If i create a View under Structure -> Views -> Entityforms (A list of all entityforms submissions), the System goves me a Error:

  Fehlermeldung
  Views cannot create normal menu items for paths with a % in them.

How should the right path be?

Thanks for helping!


texts:
Is it possible to check the privileges for a particular field? For example, I have a field in the material field_access associated with the user who accepts an ID of the user. How to check access to edit the material through it? Currently editing is possible only if the user specified in the authors.
(Google translate. Sorry for that)


texts: Local Drupal installation can't copy files to another computer on network

texts:
I want to use file_copy to copy a file from Drupal public directory to a shared folder of another

computer on the same network.
I can access the shared folder by Finder (Drupal is installed on

MAMP) but coping files in that directory gives me the same error:

  The specified file public://file.pdf
  could not be copied, because the destination directory is not properly configured. This may be
  caused by a problem with file or directory permissions. More information is available in the system log.

The shared folder is totally writable.
I tryed putting an alias on httpd.conf but no luck
Could it be an apache permission problem?
Or can I solve the problem within Drupal?

Thanks a lot


texts: Theme Views exposed filters, how to add count?

texts:
For example in the case of filtering by taxonomy terms, I would like to add the node count next to each term in the exposed filter block. Already using Better Exposed Filters module as it allows to use checkboxes instead of select list.

Is there a way to do this? I can make a nice list of the terms with node counts using aggregation, but I can't think of an easy way to use ajax that way. :-)


texts: Is there any way to see the content of the theme registry?

texts:
I was wondering if there is a way to see (print out) the content of the theme registry.

I've looked in the database; it seems to be stored in the cache table, if I understand things right, but the theme registry itself is stored as a blog.

When I looked at the blog, I couldn't seem to make any sense of what was there. It all seemed to look like hex values.


texts: How can I add a CSS class to all the tables?

texts: I want to add a table class to all the tables, automatically. How can I achieve this by overriding a theme function?


texts: How do I configure the Block Access module?

texts:
I want to use the Block Access module, but I don't know how to configure the module. I tried to find some tutorials or user manuals but I couldn't. I installed and enabled the module end I can change the permissions in the /admin/people/permissions page. I want to allow permission to a specific user role to  Edit own block content.

How can I give the block ownership to a specific user role?


texts: multiple sites use one apache solr server

texts:
I am a beginner of using Apache Solr. I made a mistake two weeks ago.
I link two of my sites to one Apache Solr server. One is dev site, another is live site. There are some different data between these two sites. But I forgot to set "read only" on dev site.

Right now, everything is messed up. The dev site data shows on live site. How can I fix this? I tried to fix, but still no luck.

My fix steps:

Download Apache Solr Multiple Search on my dev site.
Set Apache Solr Search index access as "Read only"
Reindex all queue on my live site
Wait two days
Check the live site, still messy

I really appreciate if anyone could help.


texts: View of organic groups name list with no activity

texts:
I'm running a Drupal 7 site, and I want to create a list view of group names with no activity within last 60 days. For example if user have not created any content with in those groups.

Currently groups (OG) hold different content-types/nodes i.e news, galleries, wikis, and discussions.

Can someone please help me achieve this?


texts: Fatal error - Class 'context_condition_node' in date_context module

texts:
I'm debugging a site that has completely broken - not finding too much out there and hoping for some help. The error I see is:

Fatal error: Class 'context_condition_node' not found /sites/all/modules/contrib/date/date_context/date_context.module on line 56

Anyone seen this before?


texts: How to assign "Access Results" permission per Webform?

texts:
On Drupal 7, my client would like to give a user to see a particular Webform's "Access Results". How can I assign the "Access Results" permission per Webform, beside using "Permissions per Webform"?

Thanks,
HL


texts: How do you update the default value for a field programmatically?  I know you can get the field instance info by calling field_info_instance, but how do you update that info?


texts:
I am using Drupal 7 and working on a rating site using Fivestar and Userpoints.

What I want is for a certain amount of points to be deducted from a user when he makes a post, and also points deducted from a user when he votes on a node.

The rating and points deduction works well, but the issue is negative points. I don't want any user's points to go below zero. I need to prevent users from having negative user points on the site.


texts: I have Drupal 7.14 and Zen 7.x-5.1. I cannot figure out how to simply change the background color. I have tried placing background: red; in several of the css pages but have had no luck.


texts: Why don't I get a value from drupal_static()?

texts:
This post is basically a duplicate question of one I asked a little while back: Using Static Variables in a Custom Module. Unfortunately I can't get my own solution to work.

I'm trying to use a static variable in a custom module.

function tellafriend_userfullname_function() {
  global $user;
  $var = &drupal_static(__FUNCTION__);

  if (!isset($var)) {
    // generate contents of static variable
    $var = user_load($user->uid);
  }

  return $var;
}

The static variable will be used in the form submission handler and in hook_mail().

function tellafriend_form_submit($form, &$form_state) {
  $var = &drupal_static('tellafriend_userfullname_function');
  $params = array();

  if ($form_state['values']['cv_included'] == '1') {
    $params['1'] =  array('uri' => $var->field_cv_upload['und']['0']['uri'], 'filename' => $var->field_cv_upload['und']['0']['filename'],);
  };

  // Other email set-up goes here.

  $message = drupal_mail('tellafriend', 'notify', $email, language_default(), $params);
}

function tellafriend_mail($key, &$message, $params) {
   $message['headers']['MIME-Version'] = '1.0';
   $message['headers']['Content-Type'] = 'multipart/mixed;';
   $message['body'][] = $var->field_full_name['und']['0']['safe_value'];
}

What have I done wrong?


texts: Change Content region width when Sidebar has content?

texts:
hello i have what i feel is (hopefully) an easy problem to solve. Basically i have my regions defined which is fine but i have my sidebar that i want to display on the right of the content region. if the sidebar has blocks the 'Content' region should gain a class that adjusts the width to allow the sidebar to display, if no content in sidebar then the content region should display in full width.
In the page template i have this so far

<?php if ($page['sidebar_first']): ?>
         <aside id="sidebar-first" role="complementary" class="sidebar clearfix">
           <?php print render($page['sidebar_first']); ?>
         </aside> <!-- /#sidebar-first -->
         <?php endif; ?>
         <?php if (!empty($page['sidebar_first']): ?>
         <div class="content-region-sidebar-sibling">
         <?php print render($page['content']); ?>
         </div>
         <?php else: ?>
           <?php print render($page['content']); ?>
         <?php endif; ?>

yet the line for
       <?php (!empty($page['sidebar_first']); ?>
continues to return TRUE whether the region has content or not..
i need to know how to fix this syntax so that if my sidebar region is with blocks, the content region will receive the class assigned(which is how i'm editing the width) and will not get the class if there is no sidebar blocks active on that page. Can anyone help?