texts:
I have a Drupal 8 site that has been installed with Composer. Last week, I updated Search API 1.14 and Search API Solr 3.7.

The module are in the good version, but when I run drush updatedb, the following error appears.

  [error] Search API Solr requiert ce module et cette version. Vous
  utilisez actuellement Search API version (Currently using Dépendance
  non résolue Search API (Version >=8.x-1.14 requise))

  [error] Search API Solr requires this module and this version. You are
  currently using Search API version (Currently using Unresolved
  Dependency Search API (Version> = 8.x-1.14 Required))

I checked the installed version and it is the last one. How can I fix this error?

The content of the composer.json file is the following.

    "drupal/search_api": "^1.14",
    "drupal/search_api_autocomplete": "^1.0",
    "drupal/search_api_location": "^1.0",
    "drupal/search_api_solr": "^3.6",


texts: How do I interpret the line of codes ( \ No newline at end of file) and (+ - core/jquery.once)

texts:
In the Drupal8 zircon/includes/monokai/monokai.min/css patch how do I manually apply the last two lines of code;  ( \ No newline at end of file) and
(+    - core/jquery.once).
Thank you

diff --git a/zircon.libraries.yml b/zircon.libraries.yml
index bd6a231..3358a49 100644
--- a/zircon.libraries.yml
+++ b/zircon.libraries.yml
@@ -8,7 +8,7 @@ global-styling:
       includes/fontawesome/css/font-awesome.min.css: {}
       includes/slick/slick/slick.css: {}
       includes/slick/css/style.css: {}
-      includes/monokai/monokai.min/css: {}
+      includes/monokai/monokai.min.css: {}
       includes/flexslider/flexslider.css: {}
       css/html.css: {}
       css/page.css: {}
@@ -38,4 +38,5 @@ global-styling:
     - core/drupal.ajax
     - core/drupal
     - core/drupalSettings
-    - core/jquery.once
\ No newline at end of file
+    - core/jquery.once


texts: Unable to display images after Drupal Update

texts:
I recently updated my site to Drupal 7.34 using these instructions -

https://www.youtube.com/watch?v=_uDTyzE47pQ

After update, I am not able to see the images in the site. All I see is the placeholder for image, but not the image itself. I checked and its not a path issue.

This is how it looked before -

And this is how it looks after -

Also notice that the theme has changed. I was using bartik before. Can somebody tell me if I did anything wrong or how to get the images to display? Could this be an issue with image styles?


texts: Prevent users from including their username in their password

texts:
I'm aware of the Password Policy module that has a number of features for forcing the user to constrain their passwords to certain criteria, but this module does not contain an option to prevent users from including arbitrary strings in their passwords (such as their own username).

Ex. User bob receives a validation error if they try to change their password to anything that includes the string "bob", such as "889bobisthebest99".

Does anyone know how to code custom functionality to achieve this result for Drupal 7.5 or a module that already does what I'm looking for?


texts: grabbing data and displaying it in block twig

texts:
bI made a custom module and made a custom block inside of it.

In the build () I have this.

return array (
  '#theme' => 'no_athlete_match_block',
  '#title' => 'Athletes With No Matching Name in the Database',
  '#description' => 'Displays the athletes with no matching name in the database for a given sporting event.',
);

In the .module file I have this.

function no_athlete_match_theme($existing, $type, $theme, $path) {
  return array(
    'no_athlete_match_block' => array(
      'variables' => array(
        'description' => NULL,
        'title' => NULL
      ),
      'template' => 'block--no_athlete_match',
    ),
  );
}

my twig file named block--no-athlete-match.html.twig

<div>
node: {{title}} {{description}}

Only Node: shows up. If I do dump(title) I get NULL to show up. Not sure what I'm missing. I've copied other blocks and still nothing.


texts: Which menu should a third-party module choose, between "Structure" and "Configuration"?

texts:
I noticed that some module prefers to add their menu items under "Structure," while other modules prefer to add them under "Configuration."

I thought that the reason of choosing "Structure" was because the menu items were related to some kind of "entities," but I then noticed that Rules is adding its menu items under "Configuration."
Vice versa, Views and Flags put their menu items in "Structure."

What is then the criteria to use when deciding under which menu a module put its menu items? Does the "Structure" menu contains only menu items that are related to content?


texts:
I am trying to add an affiliate script to my Drupal 7 website.
I am doing this in a custom block.

Specifically, I create a block, select the scripts text format in my WYSIWYG Editor, add the script and save. I then add the block to the page I want.

This seemed to work for a few months and then suddenly, it disappeared and stopped working (probably due to an update).

The script has the below format:

<script src="https://sbhc.portalhc.com/123456/searchbox/234567"></script>

I have tried adding the code using all text formats (Plain Text, Scripts, Full HTML etc.). I've also tried adding it using one text format and then switching to another. I've also tried adding it through the Source button on the WYSIWYG editor.

As confirmed above, the script did work for a few months before disappearing and no extra modules have been added. I can confirm the script is correct because I can see what it generates on the provider portal.


texts: Drupal Commerce: Allow anonymous users to choose their username on checkout

texts:
The default setup includes a single option in the "Account Information" pane which allows for an email address. The user's username is then derived from that.

I would like to add another field for "Username" where the user can enter their own username, instead of having it generated for them automatically based off of their email.


texts: How do I make node_gallery image thumbnails retain original proportions?

texts:
When I upload an image to a Drupal 7 node_gallery gallery, a thumbnail is automatically generated. This is good.

However, the thumbnail is also cropped to a square size. This is bad. (But note that the full-sized image is not cropped.)

I want the thumbnail to retain the original image proportions (often 2:3 or 3:4), the same as the full-sized image (just smaller), rather than being cropped to a 1:1 format.

How can I do that? Google was distinctly unhelpful in this case, showing me results only for old versions of Drupal, and even then those solutions were mostly for other problems.


texts: How to prevent the form from redirection after submission in order to see the kpr() results?

texts:
I installed Basic Cart module and I needed to completely modify its submission handler. So I used the following code:

function THEME_form_alter(&$form, &$form_state, $form_id){
    if($form_id == 'order_node_form'){
        $form['#submit'] = array("my_form_order_submit_handler");
    }
}

and It works perfectly. The order_node_form form has some values in its inputs and I need to get them. I don't know how to get the values from the $form variable so I need to kpr this variable. This is the my_form_order_submit_handler function:

function my_form_order_submit_handler($form, &$form_state) {
    kpr(1);
}

The problem is it doesn't kpr the 1 and is redirected to some where else. In the question kpr() in my form validation and submit function is not being called it has been suggested to add the following codes in form alter function and tried this code:

function THEME_form_alter(&$form, &$form_state, $form_id){
    if($form_id == 'order_node_form'){
        $form['#submit'] = array("my_form_order_submit_handler");
        $form_state['rebuild'] = TRUE;
        $form_state['no_redirect'] = TRUE;
        $form_state['redirect'] = FALSE;
    }
}

But it is still redirected and I can't see the kpr(1) result in the submission function. How can I prevent the page being redirected to some where else after the my_form_order_submit_handler function?

Thanks


texts: How to retain  tag in HTML output when added in a Views Fields?

texts:
I need to re-write some fields in my Views to output certain format for my  tag. Since the new format that needs to be written isn't actually accessible, I would need to include  tag for the original  tag.

Example

Accessible, original format

Non-Accessible, new format

<img src="/images/myimage.jpg"

Question

How to make it so that the  tag is retained and not stripped?

Please kindly share your detailed solutions in a way that a Drupal beginner like me can understand. Thank you!


texts: Taxonomy Reference Based on Taxonomy Field

texts:
I have a taxonomy with a custom field: field_uid

Users are able to create their own taxonomy terms, and when they do, field_uid is set to their UID.

I also have a content type which allows users to select terms from a common vocabulary, however, I only want them to have access to terms that they themselves created (IE terms with field_uid = current user's uid).

I've tried using entityreference and views to do this, but views seems unable to cope with taxonomy fields very well.

Thoughts?


texts: How to add a redirection at the end of Delete entity process?

texts:
I used Drupal Console to create a custom content entity called 'Service' (with command drupal geco) which generated all expected code including 'ServiceDeleteForm.php':

<?php
namespace Drupal\sel\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
/**
 * Provides a form for deleting Service category entities.
 *
 * @ingroup sel
 */
class ServiceDeleteForm extends ContentEntityDeleteForm {
}

I added some code of mine there:

class ServiceDeleteForm extends ContentEntityDeleteForm {

  protected function getDeletionMessage() {
    $entity = $this->getEntity();
    drupal_set_message($this->t('Le service « %label » a été supprimé.', [
      '%label' => $entity->label(),
    ]));
  }

  public function getQuestion() {
    return $this->t('Êtes-vous certain de vouloir supprimer le service « %label » ?', [
      '%label' => $this->getEntity()->label(),
    ]);
  }

}

which works fine.
I'd like to add a redirection at the end of the Delete process, something like  $form_state->setRedirect('elsewhere', [some argument]);
but I don't know how to do it.
Could someone help? Thanks in advance.


texts:
I'm really pulling my hair out about this one and wonder if someone can help?

Is it possible to override a module's output from the theme's template.php file?
Basically, I wan't to modify the output of the Geolocation Module without updating the module output itself.

if so, how would I go about it?

thanks a lot

Dave


texts: How to dynamically change the text of the Global: result summary based on exposed filter on Views?

texts:
There is a content type and it has a field called field_type. It's a select list and there is 5 options to select such as AAA, BBB, CCC, DDD, EEE.

I'm using the Views module to list the nodes of this content type. I added the field_type as exposed filter for this views.

In the header of the views, I added the Global: Result summary to show result summary.

 "@total results found."

What I want to do is dynamically change the text based on the exposed filter. For example if the AAA is selected on the field_type exposed filter then the results summary should display:

 "@total AAA found."

How can I do that?


texts: Access Denied After ERPal Platform Install

texts: I've successfully installed ERPal Plaform with a LAMP stack on a fresh install of Ubuntu 12.04 on a VPS, and it goes to the administrative console after install. It's fully functional until I log out. When I log out, I get an Access Denied message whenever I trying to go to the domain it is installed on. I tried to chmod 777 the document root, but that didn't have any effect. Any ideas how I can deal with this issue and get access to the home page?


texts: Taxonomy Term View with Expose filter Dropdown of Terms Name

texts:
I Have a view of Taxonomy and "not Content".
In this View I want a Expose filter of Term Name. But when ever i add Term Name as expose taxonomy's filter it shows text box and not Dropdown.

Without using relationship with content is it possible to get Dropdown filter of term's name as expose filter in Drupal 8 ?


texts: Can I render a region of my drupal site on a non-drupal site?

texts:
Here is my situation.

I'm in the process of implementing Drupal as the primary CMS for a large site with hundreds of pages. But until the data input into Drupal can be done (which will be an ongoing process over months), I'd like the older "non-drupal" pages to at least be faked into looking like they are part of the same site. Basically I just want to tack onto the old pages, the new drupal header and footer (which are independent regions).

I was wondering if there is a known way to show a region from your drupal site on a regular php page? Such as a simple drupal "region rendering function" or something?

ps. The navigation has dropdown menus so iframes are out of the question.

Any constructive insight into how I should approach this would be helpful. Thanks.


texts: Is it possible to have a block of content on a taxonomy term page?

texts: If I have taxonomy of company and term companyx when I visit www.sitename.com/company/companyx I get a list of posts with that term // vocab. Is it possible to put a block of content above the posts? Or is there another better way of creating 'landing pages' for the taxonomy terms? On Drupal 7.


texts: I needed to print a png icon instead of field label in views, so i'm posting this question and it's propper detail answer as well, in my case i need to print whatsapp icon  as a label in a field in views, this answer is based on this post, this question is flaged as closed being off-topic, but I think it may be usefull to others. this is working in D7, it may work on D8.


texts: How do I use a different structure of a theme on different pages?

texts:
The picture shows the block region demonstration of a Drupal theme that I am using.

I am new to Drupal.

As the structure is given, I want to use different structure in different pages of my site.
Say, at home page I want to use all the block regions Left Sidebar, Content and Right Sidebar. But for another page (one of the main navigation) I only want to use one of the sidebars with content and leave other sidebar. Also I want to add custom blocks at various regions on different pages.

Is this possible? If yes, how should I do it?


texts: How to store HTML data in a database field?

texts:
I'm trying to write some code for the Image marker module to allow an HTML description to be stored in the database. Currently all text is escaped and stored as plain text.

The module stores x/y coordinates and descriptions as name/value pairs in a database field, for example:

x=208&y=251&id=208-251&description=wheel;x=77&y=142&id=77-142&description=light

Can I store HTML descriptions this way? Is there a better way to store this kind of data?


texts: How to set kint() to be closed by default?

texts:
I find that when expanding Kint widgets, if the object is sufficiently large, the loading time can be quite slow. It appears, when you expand the root level, it also expands child objects. I would prefer that it keeps all children closed until I decide to expand; although I'm not sure if this will have any impact on performance.

Where can I configure Kint for Drupal?


texts:
Here is what I am trying to do, I have a bookmarklet with the following code

javascript:location.href="http://mywebsite.com/getsource?url="+encodeURIComponent(location.href);

I want to fill in the url into a field on the page "http://mywebsite.com/getsource"

After asking around a bit, I was provided this piece of code.

<input type="text" id="edit-url-field" value="<?php echo $_GET['url']; ?>" />

My question is .. how do I implement this in Drupal 7?


texts:
how i can knowing if the checkbox is checked or not on the form

function darksite_config_page() {
  $form['darksite_status'] = array(
    '#title' => t('Enable pop up screen'),
    '#description' => t('When enabled, a pop up screen will be displayed on the home page.'),
    '#type' => 'checkbox',
    '#default_value' => variable_get('darksite_status', 0)
  );

  return system_settings_form($form);
}


texts: How to implement a text field formatter that renders a URL as the image?

texts:
If a node has a text field with the url of an image as its value, how can I render this field as the image?

The image does exists it will be given the image url. I have to write that url into the text field.

Now using this url the value of this field should be an image when the node is viewed. But should be again editable textfield when editing the node.

And if in case the image doesn't exits a string can be shown "no image available".


texts:
I want to add some extra javascript (few files stored in my account, and some inline javascript) for a specific node. Based on the answer to this question, I tried adding a few files to the node alias "insert-pub" by doing this in the template.php in /themes/garland (just trying out the garland theme for now):

  function garland_preprocess_node(&$vars) {
     // The line below was already there.
     $vars['submitted'] = $vars['date'] . ' â€” ' . $vars['name'];
     // Added the lines below.
     // Want to include my javascript files and inline scripts for specific nodes.
     $node =& $vars['node'];
     debug($node);
     debug($node->type);
     if ($node->type == 'insert-pub')
     {
          drupal_add_js('/sites/all/scripts/MyLib.js', array('type' => 'file', 'scope' => 'header'));
          drupal_add_js('/sites/all/scripts/Utils.js', array('type' => 'file', 'scope' => 'header'));
          drupal_add_js('var MyAjaxLib=new MyLib();
               function loadInput(){ alert("Hello"); }', 'inline');
     }
}

But I never see the links to the JS files or inline JS scripts in the source of the page, when I load the page in the browser by going to [www.mysite.com/insert-pub]. Where am I going wrong? Even the debug() calls above does not seem to print anything in the browser.

I am a Drupal 7 newbie, so looking forward to some hand-holding. Thanks.


texts:
I have no well enough experience in themeing with view, It is also the first project I used view. In this page, I would like to add javascript event to  qq under category_page.

When clicks qq I want to navigate to www.example.com/qq.  But I know I have to write javascript in its respective template file, my problem is which template file is suitable to write. I also upload screen shot, to clear my question.

Thanks


texts:
I am running a legacy project with four developers on it. Occasionally I need to make changes to settings.php for remote server settings and/or a settings override example template in this directory. It seems like any time cache is cleared, the default folder permission is changed to not be writable, and the settings file changed to 644. Which I get.

However, the next time someone does a git pull and there are changes in that file, git says it does not have permission to touch it and the pull fails.

Is there any strategy to handling this? I tried searching but came up short.

Edit: this may sound like a Git question at a glance, but it’s due to how Drupal changes certain directories to be read only and not writeable which causes issues when those files update and are pushed to a repo for others. Therefore there must be some strategy to handle this.


texts: Can't hide fields in user registration form at new menu path

texts:
I have a menu path which rendered User Registration Form.  The problem is I did hide fields like "Email", "password" and "status" by setting #access to FALSE. It is not working.

When I have done the same thing in hook_form_alter(), it does work.

This is my code.

/**
 * Implements hook_menu().
 */
function MY_MODULE_menu() {
  $items['admin/author/create'] = array(
    'title' => t('Author'),
    'page callback' => 'MY_MODULE_author_form',
    'type' => MENU_CALLBACK,
    'access callback' => TRUE,
  );

  return $items;
}

/**
 * Author form.
 */
function MY_MODULE_author_form() {
  drupal_set_title('Create Author');

  // Getting User Register Form
  $form = drupal_get_form('user_register_form');

  // Change Username to Author Name
  $form['account']['name']['#title'] = 'Author Name';

  // Exclude User Registeration Elements
  $form['account']['mail']['#access'] = FALSE;
  $form['account']['pass']['#access'] = FALSE;
  $form['account']['status']['#access'] = FALSE;

  // The path to which the form will be submitted.
  $form['#action'] = url('admin/people/create');

  return $form;
}

I think I can alter the form in MY_MODULE_author_form().

Is there anything wrong with my code?


texts: Are Drush configuration files compatible across all Drush versions?

texts:
I've been using the same drushrc.php and aliases.drushrc.php files with Drush 6 and 7 and haven't noticed any problems; however, I also haven't used very complicated Drush configurations in the past.

I'm now using different versions of Drush (6-8) for different sites and am trying to confirm whether there are any significant compatibility issues with configuration files in different versions of Drush. I can't find a conclusive answer anywhere in the Drush documentation; anyone know?


texts: E_DEPRECATED and E_NOTICE errors showing in dblog / syslog despite disabling in php.ini

texts: I'm still getting a lot of PHP Deprecation and Notice messages in my logs despite having these values turned off in php.ini. According to admin/config/development/logging I should only be displaying errors and warning if that is relevant. Is there some other way that Drupal might override my php.ini settings?


texts: How to manipulate some fields using Views PHP?

texts:
I'm trying to manipulate some fields on Views with Views PHP.

I have a (term) field for author(s). It can have one author or more.

Normally it looks like as that:

Book Title | Author

My First Book | Name1 Surname1, Name2 Middle2 Surname2

My Second Book | Name3 Surname3

etc.

What I want to do is to print names as that:

Book Title | Author

My First Book | Surname1, Name1 - Surname2, Name2 Middle2

My Second Book | Surname3, Name3

In order to do that, I used Global: PHP field with Content: Authors.

Value code inside Global: PHP is that:

$names = $row->field_authors;
foreach ($names as $name) {
  $parts = explode(' ', $name);
  if (count($parts) == 1) {
    $wanted = print($name);
    continue;
  }
  $last = array_pop($parts);
  $wanted = print ($last  . implode(' ', $parts));
}
return $wanted;

Output code is:

<?php print $value; ?>

But it doesn't return anything. I tried some other similar code but nothing changed.

Is it about the Content: Authors field (multiple field settings etc.) or am I wrong about the code I used in the Global: PHP field?


texts: How to create image gallery and integrate it to lightbox2

texts: I have a content type Product with a field Images. There are 4 photos. When i go to the product-node page i want to click on one of the photos (1 of 4) and open a popup/modal window where i would like to see all 4 photos (not only 1, as  Lightbox does). How can i do that?


texts: How to import and merge existing site from svn to git?

texts:
I'm working with a site that has been using Subversion for version control and we'd like to swtich to using git instead. It seems like it would make the most sense to clone the Drupal project git respository from drupal.org, checkout the branch that represents the version closest to the existing site, create a new branch from that point and then somehow merge the existing svn repository into that branch. Is it possible to do that last step, to avoid losing the svn history?

For what it's worth, in one of the Pantheon demo screencasts they're doing something similar (around the 3 minute mark). It looks like they are starting with a backup of the site though, rather than importing a repository and its associated history.

Is there a better way to handle this scenario?


texts: Hide option Generate automatic URL alias for all languages on user register form?

texts:
Do I need to write a hook or may be I can hide this using amdin interface?
I am using Pathauto i18n, LoggingToBoggan.
The option "Generate automatic URL alias for all languages" is displaying on user register form, and my users can't understand why. I want to hide it only on register form
this code is not correct and does not work:

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

  /* hide Generate URL alias for all languages */
  if (isset($form['pathauto_i18n_status'])) $form['pathauto_i18n_status']['und']['#access'] = FALSE;
}


texts: Core Update to 8.9.4 Removed Block Visibility Options?

texts: Recently updated core from 8.9.2 to 8.9.4, in doing so the options to place blocks on specify pages is now gone?


texts: How to load image from Custom Module with javascript?

texts:
I'm trying to build a custom module
https://github.com/alexseif/drupal_infinite_scroll and
I need to load the image in the images folder "images/ajax-loader.gif"
in the js file alx-infinite-scroll.js

I have this in my js file
drupal_get_path('module', 'alx_infinite_scroll') + '/images/ajax-loader.gif' I have no clue where to start, any help would be much appreciated and/or link to the relevant documentation if possible.


texts: paragraphs_update_8018 takes very long time to finish

texts:
The paragraphs_update_8018 update takes very long to complete (we have over 1 mio. paragraphs), as of now it's already been over 1h40m and it's still running. EDIT: it finished after 1h47m

My question is: is it possible to run this update without maintenance mode? I don't want to take the site down for so long for this update.


texts:
I seem to be having troubles creating a node through the JSON API. I am able to get nodes just fine and generate an access token via oauth but I am having no luck creating anything.

This is the content of the CORS file.

cors.config:
    enabled: true
    # Specify allowed headers, like 'x-allowed-header'.
    allowedHeaders: ['*']
    # Specify allowed request methods, specify ['*'] to allow all possible ones.
    allowedMethods: ['*']
    # Configure requests allowed from specific origins.
    allowedOrigins: ['*']
    # Sets the Access-Control-Expose-Headers header.
    exposedHeaders: false
    # Sets the Access-Control-Max-Age header.
    maxAge: false
    # Sets the Access-Control-Allow-Credentials header.
    supportsCredentials: true

I also have have the permissions turned on for creating a node for my content type under the consumer. Any suggestions on what I can try next?

These are the permissions for the consumer role.


texts: How to remove link to profile under title, when rendering a profile as block in the module Profile2

texts:
I'm rendering a user customer profile in a form using the code:

$profile = profile2_load_by_user($account, 'customer');
$form['customer_profile'] = array(
    '#type' => 'item',
    '#markup' => render($profile->view('block')),
);

which works rather well, except that the title (in H2 tags) is rendered as a link back to the profile.

I want to get rid of that link, but as there seems to be no obvious property, to specify if you do or do not want a backlink. Not in the $build array parameter of hook_entity_view_alter, nor in the $elements parameter for a '#pre_render' callback. In a '#post_render' callback, it's too late because the link is already inserted into html.

So, how do I get rid of it?


texts: How to add a "Remove Taxonomy term" option to VBO instead of only "Add taxonomy term"?

texts:
In Drupal 6 VBO I had an option to check if I want to add, remove term for example

In drupal 7 view I can just add it (check the box) and not remove it for some reason, what am I missing

I am attaching a screenshot from Drupal 6 where I could add, remove, even replace terms, how to do it in D7 is the question


texts: Override Search module's textfield CSS ID

texts:
this is what I am using to override the Search module's submit button's CSS ID:

function hook_form_alter(&$form, &$form_state, $form_id) {
    if ($form_id == 'search_block_form') {
        $form['actions']['submit']['#attributes']['id'][] = 'custom_css_id';
    }
}

Now I want same thing for the textfield input.


texts:
I am using the Services (7.x-3.7) module to provide a REST API to our website content. However I have a problem with returning images. I am using Scald (7.x-1.1) to manage our media items. This means that when I attempt to GET a node (example.com/rest/node/25592) I get each field for the node in question nicely wrapped in JSON but for the image instead of an image path and file-name I get the Scald ID as follows:

field_event_image: {
und: [1]
0: {
sid: "15775"
}-
-
}

How can a client application reference the image path from the SID? I know I can use example.com/atom/15775 but this gives me back a themed node page containing the image - it contains the menu and default theme elements so it is not trivial or efficient to retrieve the image path from the source - though it could be done with some client side parsing. What I am looking for is a means to reference the image path directly using the SID. I am trying to keep the number of API calls to a minimum. Alternatively is there some way to configure the Services module to return the image path?


texts:
I am trying to use the field data inside of a views template to modify its output. I looked at the available fields with devel, and, inside of a field template, I used the following code:

$row->field_field_twitter_screen_name[0]['rendered']['#markup']

and many more like this. It worked fine. The only issue is that the page was giving me a lot of notice message from this code:

*   Notice: Undefined offset: 0 in include() (line 28 of [path-to-file].tpl.php).

Is this not the correct way to get data? If so, what is it?


texts: How to change the order of banners using the weight module?

texts:
I have add banners. I want to change the banners order. I have installed the Weight module. I have also added weight in content type but it does not reflect in node.

So how can I change the order of banners?


texts:
I have heavily modified an Ubercart form.

I have tried to remove the initial validation placed on this because I'm using a whole host of different fields.

For some reason, however, the validation is still getting executed.

Why would this be the case? Am I removing all sources of validation correctly?

  array_unshift($form['#submit'], 'client_mod_uc_cart_checkout_handler');
  $form['#validate'][] = 'client_mod_uc_cart_checkout_validate';

I have also tried setting $form['#validate'] to array();

However, upon submission, I get:

First name field is required.
Last name field is required.
Street address field is required.
City field is required.
Postal code field is required.
First name field is required.
Last name field is required.
Street address field is required.
City field is required.
Postal code field is required.

Why would this be the case?


texts: Search API / Facets: How can I define a range / manipulate the search query in D8?

texts:
I've defined a facet for the field "Authored on". I'd like to create display filters like "current week", "current month", etc. on my website.

The creation of the links was no problem. I have facet links like this:

Current week

How can I manipulate the search query if a period has been selected? I need something like "get all search results, which are younger than tstamp of monday this week" or "get all search results between date X and date Y".


texts: Add additional fields to select list on Webforms

texts:
In Webforms type field of Select options looks something like this:

But what if I need to add extra fields per each select option? Fields that are drop-down and you can select amount (number) of quantity.

So what it does is that user fills the form for a product query. They select products from the select list and select the quantity for each item. But how do you do that with Webforms?


texts: Can I use taxonomy term as relationship in view?

texts:
I created a content type called 'Job' in which I added:

a 'Company name' field of term reference type
a vocabulary 'Organizations' containing company names as terms

I want to create a view of nodes of type 'Job' in which I want to display the email of the user who have created it?

How can I do so?

Notes:

When I try to create a relationship using the company name field, it does not show user email in fields and when I use author as relationship its showing?
I have both relationships (ie relationship on user + relationship on taxonomy term), but is it possible to use only one i.e company name?
I have created 'company page' as content type containing email id and user reference field so it can relate to this?


texts: Slight design problem with Roles, Rules and Profile2 on my site

texts:
I'm a little stuck with the registration flow on my site. What I have is a multi-user environment, where each user can, but does not have to, create a secondary/Profile2 "shop" profile.

Now I don't want to just expose the Profile2 shop type to everyone. So I've set up a shopkeeper role, and would like to somehow allow users to request or opt into the role.
This isn't for security or anything. It just doesn't look professional having the menu link available to users who don't want or need the profile. Also, some newbie is bound to get curious and enter random crap, which will later mess with the display of their content.

My solution was to use a flag on the user page, which triggers a rule to promote the user, but the problem is; there's no Flag option to prevent users from being able to flag other user's accounts. Unless I use a page template to hide the flag link, but that's a perhaps a little too hacky, and as far as I understand, doesn't actually disable the link.

All I really want is some sort of link or checkbox somewhere(preferably on the user-page) saying, "I have a shop, lemme create a profile". So if anyone has a suggestion for my issue, it would be greatly appreciated!

Cheers,

Matt


texts:
So I haven't yet been able to find a solution to this without using a preprocess function to check for duplicates or just using the 'tagadelic' module.. it'd be nice to get some closure.

How do I configure a (block) view to only display a list of terms for a vocab, each term displayed once (maybe followed by a number indicating how many times it's used) - even though the term may be used by multiple nodes? 'Distinct' doesn't do the job.. Fields 'Taxonomy:All terms' and 'Taxonomy: Term' both yield similar duplicate item when the term is reused by another node.

It's a fairly basic request, I'm sure I'm missing something but can't find a solid answer for dealing with it in views


texts: How to apply patch and require a module both at the same time through composer?

texts:
I am trying to install a module CookiePro on Drupal 9 site. CookiePro has no Drupal 9 release. But this patch can make it work on  D9.
Now confusion is that how do i install this module and patch both together. I tried lando composer require drupal/cookiepro and added the patch to extras --> patch section in composer.json. With both ways i am getting compatibility issue
drupal/cookiepro 1.0.0 requires drupal/core ~8.0


texts: Deleting translate interface strings programmatically or using drush

texts:
I need to delete some translated strings added using t() function, I've about 17000 string to delete is there a way to delete it using a SQL query or drush command? in which table those strings are stored?

Thank you.


texts: I need to show the search box on that page and specific search if sometime type related news then search result appear. I need only the search box for this content type.


texts:
I want to add a checkbox-field to each image I upload (like the title- or alt-fields) , to set the option whether the theme should render the image as a gallery or not. the value should be saved in the db. int(1)

I don't want to install heavy modules for this...

edit: but if there is no other option, I take the module :D

is there maybe a strategy I should use to solve the problem? writing a widget or something? hooking into the images_schema ?


texts: Webform POST handler, add API/header creds?

texts: Using the Remote POST handler in Webform 5, is there a way to add basic auth / API key to the request leveraging tokens or referencing a const? I'd like to find a way not to hardcode actual values.


texts: Media module to select images from flickr, copy them locally?

texts:
All our photos are on flickr. I'd like a user friendly way so that a content editor can select an image from flickr and use it on a page, e.g. in an image field.

I've used Media 2.x before which works fine for offering the user a selection mechanism for images, and to upload new ones.

I'd like that to include a browser for flickr images from our flickr account, and when the content editor chooses one, the original image should be downloaded from flickr and imported to Drupal, just as it would if the user had provided an image from their computer.

I've looked at media_flickr but this does not seem to be offering what I'm after. I looked at flickrsync but this is no longer maintained/developed for D7. Same story for flickrriper.

Has anyone done this? Is "there a module for that" which I've missed?


texts:
I am new to Drupal, I am trying to move an existing site from serverA to serverB.

When I visit

http://serverB/sites/default/files/styles/thumbnail/public/publications/43026/cover.jpg

I get Error generating image.

I am using Drupal 7.22, on an ubuntu server, PHP Version 5.4.9, have php5-gd and mod_rewrite installed and activated. Error log of apache server is empty. I also have the following directories created.

mkdir -p /var/www/sites/all/files/styles/thumbnail
mkdir -p /var/www/sites/default/files/styles/thumbnail
chmod 777 /var/www/sites/all/files/styles -R
chmod 777 /var/www/sites/default/files/styles -R

How can I fix/find the source of this problem. Where should I look for some useful error logs.


texts: I can't render default values on form element in theme_table()

texts:
For the last few days and some of last week I've been trying to fix up the interface of a page we have on one of our modules since it was difficult to use. I decided to take this data and just display it in a table so that it's simple and organized by column.

Here is a very basic recreation of the code.

function _ss_menu_zone_test($form, $form_state) {

  $formfield = array(
    '#type' => 'textfield',
    '#default_value' => '10' // default value set
  );
  $formselect = array(
    '#type' => 'select',
    '#options' => array(1,2,3,4,5,6),
    '#default_value' => 3  // default value set
  );

  $tablesort_headers =array(
    array('data' => t('Price'), 'field' => 'price'),
  );

  $tablesort_rows = array(
    array('price' => 'test row format 1'), // example of basic string row
    array('price' => array('data' => 'test row format 2')), // example of simple string but using data
    array('price' => drupal_render($formfield)),
    array('price' => array('data' => $formfield)),
    array('price' => drupal_render($formselect)),
  );

  // render the tablesort of menu items.
  $form['category_' . $tid]['items'] = array(
    '#theme' => 'table',
    '#header' => $tablesort_headers,
    '#rows' => $tablesort_rows,
    '#sticky' => TRUE,
    '#attributes' => array('id' => 'zone-items-' . $tid)
  );

  return $form;
}

In this example I have one column for the test data and a couple rows to show the differences. The primary issue I've run into here is if I try to add a form API textfield to a cell somewhere it drops value for the #default_value. the field renders correctly with any other key I've specified.

Does anyone know how to go about getting this #default_value to actually populate the field like it does EVERYWHERE else in the Form API?


texts: How to create a multilingual node programmatically?

texts:
In the last days I tried to migrate a multilingual CSV file to Drupal 8 without success, so finally I decided to use a Batch Process to accomplish the task.

At this moment I have the batch process working, but at this point I need to create my nodes and create the translation. So, how to create a multilingual node programmatically?


texts: Limit the results returned by 'published'

texts:
I am new to the Database API and SQL queries in general. I needed to create a custom module that could be given a list of fields and would output the average value of each of these fields. I am pleased to have got my module to do this.

Unfortunately it includes all of the values for my fields, irregardless of whether they belong to a published node or not. To get it to exclude results from unpublished nodes I'm guessing that my query needs to draw in information from the node table. Could someone please point me in the right direction of how to exclude results from unpublished nodes?

Please find my module code below.

    function custom_aggregate_data_block_info() {
  // This example comes from node.module.

   $blocks['custom_data'] = array(
    'info' => t('Custom Data'),
// DRUPAL_CACHE_PER_ROLE will be assumed.
  );

  return $blocks;

}

/**
* Implements hook_block_view().
*
* Prepares the contents of the block.
*/

function custom_aggregate_data_block_view($delta = '') {
  // This example is adapted from node.module.
  $block = array();

  switch ($delta) {

      case 'custom_data':

    // initial output for block
        $block['subject'] = t('feild test');
        $blockoutput = "
";

    // searches the database and displays the results in a block

      /* database table name, table cell name */
      /* ie DRUPAL_MACH_NAME_value, field_data_DRUPAL_MACH_NAME */
      $feilds_to_query = array ("field_test_2004","field_test_2005");

      foreach ($feilds_to_query as $dbfeild) {
          // Do something with each $record
          $dbfeild_tablename = $dbfeild + "_value";
          $dbfeild_cellname = "field_data_" + $dbfeild;
          $querystring = "SELECT " + $dbfeild_tablename + " FROM " + $dbfeild_cellname;
          $query =  db_query($querystring);

          $total_field_value = 0;
          $total_records_field_value = 0;
          $average_records_field_value = 0;

          foreach ($query as $record) {
              // Do something with each $record
              $total_field_value = $total_field_value + $record->$dbfeild_tablename;
              $total_records_field_value = $total_records_field_value + 1;
          }

          // when looping through the results is finished then average the total by the number of records returned.
        $average_records_field_value = $total_field_value/$total_records_field_value ;

        // add the averaged data to the values stored ready to be returned
        $blockoutput .= "
Average results: " . $dbfeild . ": " . $average_records_field_value . "
";

       }

       // when finished looping through all the queries then close the html div, then return the results as a block
       $blockoutput .= "
 ";
       $block['content'] = $blockoutput ;

    break;
  }
  return $block;
}

Note that I have the case statement included as I plan to make use of several blocks in the completed module.


texts: Migrating a forum created with Advanced Forum 1.x branch from Drupal 6 to a Drupal 7 site running Advanced Forum 2.x branch?

texts: What's the best way to do it? What module(s) should I use to export the data from the Drupal 6 site and import the data into Drupal 7 and what do I need to think about regarding the different branches? Please also describe the process if you have experience with it.


texts: How to display entity label using entity reference field checkbox form display

texts:
I am working with Drupal 8. And I want to create a field of entity_reference type. The field has a reference to context_question entity. And the field is displayed fine, but without any description beside the check boxes.

The context_question entity has a label field and I want exactly the label be displayed beside the checkbox in my first entity. What should I change in the code? Or do I need to create the fieldFormatter?

$fields['context_question'] = BaseFieldDefinition::create('entity_reference')
  ->setLabel(t('Context Question'))
  ->setDescription(t('Reference to context-question-type'))
  ->setSetting('target_type', 'context_question')
  ->setDisplayOptions('view', array(
    'label' => 'above',
    'format' => 'label',
    'weight' => 15,
  ))
  ->setDisplayOptions('form', array(
    'type' => 'options_buttons',
    'weight' => 15,
  ))
  ->setCardinality(1000)
  ->setDisplayConfigurable('form', TRUE)
  ->setDisplayConfigurable('view', TRUE);


texts:
I've setup a Drupal Commerce site selling licensed roles per instructions on https://www.drupal.org/node/2039687 The same pages says:

  The customer receives the role referenced by the purchased license
  product. Changing $license->product_id (from "Basic Membership" to
  "Premium Membership", for instance) changes the owner's role.

However, it is unclear how to change the $license->product_id. Can anyone clarify can this be done in some kind of UI or rule, or if it should be done in custom module then which hook to use?


texts:
I have created a content type and used this in Views. Means this content type is always display via Views only . When searching for a keyword these nodes are displaying in the search result page which is fine.

When clicking on the result it opens the individual node content page but I want to open the Views page where these nodes are in use.
Please help if anybody know the solution.


texts: Why is my rule that reacts on event "After updating an existing user account" firing twice?

texts:
I have a rule that e-mails me if a user updates a value of a field on their profile (this value is the name that is displayed for that user on the site; I e-mail changes to the names to make sure no one changes their name to something insulting, etc.)

However, the rule fires twice for a reason I don't understand.

The rule has a condition compare data value in which it checks to see if the account-unchanged and account variables have different values for the same field.  When I look at the rules debug log, I see that during Reacting on event 'After updating an existing user account', there is a second Reacting on event 'After updating an existing user account' within the first, and so the rule gets triggered twice.  How can I prevent this from happening?

If it helps, here is the rule:

{ "rules_notify_if_user_changes_name" : {
    "LABEL" : "Notify if user changes name",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules" ],
    "ON" : [ "user_update" ],
    "IF" : [
      { "NOT data_is" : {
          "data" : [ "account-unchanged:field-acc-displayname" ],
          "value" : [ "account:field-acc-displayname" ]
        }
      }
    ],
    "DO" : [
      { "mail" : {
          "to" : "myemail@myemail.com",
          "subject" : "[account-unchanged:field-acc-displayname] changed name to [account:field-acc-displayname] (UID: [account:uid])",
          "message" : "[account-unchanged:field-acc-displayname] changed name to [account:field-acc-displayname] (UID: [account:uid])",
          "language" : [ "" ]
        }
      }
    ]
  }
}


texts: Drupal 8 Equivalent of Drupal 7's disabling a module without Uninstalling it

texts:
I noticed that I can't just "disable" a module in Drupal 8. As disabling it deletes all the config data of that module and completely uninstalls it. There are times I just want to disable a module to see if that is causing issues, but I have no way to keep its config data intact like how D7 can just disable, but not uninstall.

How would one do something like this in D8?


texts:
Drupal 7.5, PHP 5.6.27 Debian 8, remote host.

We are running into a problem where some people can't log in some of the time and sometimes it works if they try multiple times. Users have reported the issue with different browsers and only a small percentage of people seem to be affected. Please note that I can only reproduce the error on occasion, and very inconsistently.

Watchdog simply shows that a session is opened for the user, even if the front page shows that they are not logged in.

Edit: Users can usually log in if they enter the wrong password first!

Things I've tried:

changed cookie_domain from www. to .
made sure rewrite condition allows https
cleared Drupal cache
we have no external caching
added redirect from port 80 only to default-ssl.conf
Users can't always log in with a one-time log in link generated with drush uli "[username] (the site will ask them to log in)
creating a custom login module to set a new custom session suggested here
added some cookie configurations to the sites/default/settings.php file as suggested in this post
installed the website on a different environment with PHP 5.5 and different settings.php .htaccess and php and mysql configurations.

Known Workarounds:
May or may not provide clues.

Sometimes if we change a user's password, they can get in that way
If a user enters the wrong password first on purpose then logs in, they are able to log in
Sometimes we can provide a one-time log in link for users to get in, but that doesn't always work

Edit: I've managed to recreate the issue on a local development environment with different settings files. I removed all the settings files information from my original post since I know now that they are not relevant.


texts:
views are created successfully, now i am not allowed to make change any changes to the view neither i am able to add fields apply filters. Any action i do on the view i am getting a alert message as below.

  An AJAX HTTP error occurred
  HTTP Result Code: 200
  Debugging information follows
  Path:/admin/structure/views/ajax/display/testimonials/block/row_plugin
  StatusText:OK
  a=("44,152,171,160,170...... so on a large number list")

My view Screen looks like this

I am not sure why i am getting these question marks on edit view


texts: With a view of flaggings, how do I get the flagged entity?

texts:
I want to create a view of flaggings and show content from the flagged entity.
However, on a flaggings view (Flag 4.x, Drupal 8/9), when I try to add a relationship, I can only add a relationship to the User, not the flagged entity.
Is this functionality not available in Flag?
When I create a view of nodes and want to pull in the flags, all I have to do is add a relationship to the Flag and it pulls in the flaggings automatically. So the Flag module supports going from nodes to flaggings, but how do I go from a view of flaggings to the flagged nodes?
Why I am trying to do this
Normally, I would just go from nodes to flaggings. However, this time, I have three different flags, and the same node may be flagged by multiple flags, and I want to show an entry for the node for each flagging, not one entry for the node for all flaggings.


texts: Updating existing users with User Import module

texts:
I'm trying to update user profiles using the User Import module. Under 'Update Existing Users' option, I have set profile to replace data. However, when I try to import the new profiles, I always get the error message that the users are duplicates and the new profiles do not get imported.
Is there a way round this, so that I can update user profiles with User Import?


texts:
When i am trying to upload image as a Authenticate user, After upload i am not able to see preview. fields got disappear fully.

If i try to do as a admin, i am able to see that.

Any suggestions?


texts: date_default_timezone_get() returns the wrong timezone

texts:
I have several Drupal 7 sites using the same installation in the same server. Two of those sites are returning "Europe/London" when running date_default_timezone_get(). This timezone is different from the one returned by drupal_get_user_timezone() or variable_get('date_default_timezone'), which (correctly) return "America/Denver". For the rest of the sites the returned timezone is the same for all three functions.

The fact that I get a different timezone with the php function is creating issues for those two sites; for example, token replacements of date field are returning London time, not the site timezone's time.

What may be causing this discrepancy? Is there any way to correct that? I tried including the line date.timezone = "America/Denver" in php.ini without success.

I'm running php5.6 on Apache 2.4.36


texts: How to add HTML5 history.pushState() to ajax callback?

texts:
Somethink like this not working:

$commands[] = ajax_command_invoke(null, 'history.pushState', array(NULL, NULL, 'path'));


texts: Add meta tag description, page title and abstract programatically

texts:
I have created a custom page using a tpl.php file and I want to add meta tag page title, abstract and description that page. Can anyone show me how to add these meta tags programatically to custom page?

$description = array(
                 '#type' => 'html_tag',
                 '#tag' => 'meta',
                 '#attributes' => array(
                 'name' => 'description',
                 'content' => 'here all description goes',
               )
 );
drupal_add_html_head($description, 'description');

This is the code I am using to add description to my head.
Thanks in advance.


texts: search_by_page search box will not submit the search for authenticated users

texts:
When an authenticated users searches the site using the search block from the search_by_page module the form does not have the needed <input type="hidden" name="form_token" id="edit-search-block-form-form-token" value="#####"  /> so the results can't be returned to the user. The following error message is shown:

The form has become outdated. Copy any unsaved work in the form below and then reload this page.

Where should I look to correct this bug? Is this a theming issue?

HTML from the search block:

<form class="search-by-page-form" action="/search-site" method="post" id="search-by-page-form" accept-charset="UTF-8" _lpchecked="1">

<input type="text" id="edit-keys" name="keys" value="" size="30" maxlength="255" class="form-text typeMode">

<input type="submit" id="edit-submit--2" name="op" value="Search" class="form-submit">
<input type="hidden" name="form_build_id" value="form-#####-#####">
<input type="hidden" name="form_id" value="search_by_page_form">

</form>


texts:
I would like to basically make a node with some tabs on the left that switch what's being viewed on the right. I can structure the content however I'd like since it's a node; is there a way to simply make the content display inside vertical tabs, like on the node editing forms, but when viewing the form?

Does the Render API allow rendering content in vertical tabs in a node?


texts: Exposed Filter Not working in Views Json Query

texts:
I am using Views Json Query to fetch JSON data from a URL and display result in a view.

I added certain filter criteria to the view, and created multi valued select option, But it is not working - When selecting each value it displays same results.


texts: why Cache-tags is different if i am logged?

texts:
I try to understand how drupal core cache tags is add :

this is my tags on my home when i am logged :

node:121 node:158 node:23945 node:23946 node:43328 node:491 node:514 node:59139

It's good, this relate my node on my home.

But if i check my home in anonymous, this is what i get :

node:115 node:121 node:153 node:158 node:172 node:18240 node:18244 node:18256 node:23945 node:23946 node:307 node:43328 node:45 node:491 node:514 node:59139 node:59143 node:59144 node:59145 node:59146 node:59147 node:59148 node:59149 node:59193 node:59197 node:59239 node:59269 node:59283 node:59289 node:59293 node:59522 node:59770 node:60375 node:60390 node:60415 node:60418 node:60480 node:60542 node:60606 node:60616 node:60727 node:60785 node:60793 node:60819 node:60824 node:60827 node:60873 node:66011 node:66019 node:66026 node:66028 node:66030 node:66036 node:66039 node:8555 node:8561

And most of this tag is wrong for the home page, how drupal find them ?

I know there is a cache context, but its the core who add this tags

EDIT

After some debug i got some answer :

Context : my menu is render by core block menu in region.

For anonymous user, drupal add the tag node:id for every item in my menu.

if i remove the block, all node:id tag is removed.

So i have 2 solutions :

For all user who hasn't bypass node access permission drupal add every tag from the menu block render.

So i can try to fix the access check on the menu

Remove the drupal core block menu from region and build my own block programmatically and load my menu inside with menu_tree service.

i have try the second point and since its not drupal who render my custom block, tags is not add.

But for me the best way is to find a way for fix the check access.

i can't clear all the node in the cache when someone edit a node in the menu.

For that i want use the tag menu_link_item but not the node:id...


texts:
I have installed a drupal7 multisite.

Views module is present in main site (sites/all/modules/contrib)

Custom module is present in site1 (sites/site1/modules/custom)

In custom module (site1), I have written code for integration of a database table to Views (using hook_views_data).

But in site1 views, this table is not being listed. What might be the problem ?

Basically I want views module to be enabled in all sites. A custom database table to be integrated to views in a particular site (say site1). Is there any method to achieve this ?

Note : The custom module works fine on a non multisite instance.


texts: How to provide custom template declared inside my theme .theme file as variable inside page twig template

texts:
In my theme, I implemented HOOK_theme to declare custom twig template.
How can I provide/preprocess this template as variable ready to to output inside my page.twig.html template ?


texts: How to set the value of a hidden field using form_set_value?

texts:
In form validation I have to set value of a hidden field. I tried like below

\Drupal::formBuilder()->setValue($form['maintenance_type'], 'R', $form_state);

form_set_value($form['maintenance_type'], 'I', $form_state);


texts: Remembering the address of the calling page of a form (Drupal 7)

texts:
I have created a little module that implements hook_menu and when the menu item is selected it displays a form that is defined as so:

function documentation_menu_nameform() {

  $form['documentation'] = array(
    '#type' => 'text_format',
    '#title' => t('Documentation'),
    '#default_value' => 'This project has not been documented.',
    '#format' => NULL,
    '#weight' => 0,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit')
  );
  return $form;
}

Now when this menu item is selected it brings up a form at the address ?q=documentation_menu and in my form submission hook I would like to return to the page the user was on before they selected the menu item but I can't figure out how to access and/or store this path.


texts: PHP Fatal error failed opening required file

texts:
I am trying to build a site with Organic Groups (a site like myfamily.com, with the groups being individual families), and I am getting a persistent PHP Fatal error

PHP Fatal error:  require_once(): Failed opening required
/var/www/.../sites/all/modules/addressfield/addressfield.install
 (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/viewstest
/includes/module.inc on line 330

I am getting a WSOD when I try to navigate to the site. I have tried clearing caches, I have tried registry rebuild, No luck. My backup is also experiencing the same issues, so I am not sure what is going on.

I have seem some references to this but cannot come up with a firm answer as how to fix. Does anyone know what is happening and how I might go about fixing this?

I have also posted on d o : https://drupal.org/node/2278519 .


texts: cron import more than 2 files with feeds

texts:
I'm on Drupal 7 using services and feeds. We have 10 XML files we're trying to upload during cron that doesn't work.
If I do it manually by using wget/cURL via SSH only 2 files are uploaded. If I run  cron 1 min later, only the two XML files are uploaded.
Where can I set cron to upload more than 2 XML files during the feeds cron job?


texts:
As you know t() function in Drupal is translation function.

t('base value') returns translated expression for current language.

I want to know, is there any function in Drupal that takes translated expression as a parameter and returns base value ?

$translated = t('base');
$base_value = reverse_translation ($translated)

I am searching for reverse_translation function


texts:
I am using Drupal 8 from github:drupal/drupal@a9ac0fbf17, but having problems creating custom template, using Twig template engine.

Here is template file structure:

.
├── README.txt
├── screenshot.png
├── templates
│   └── html.html.twig
└── custom.info.yml

html.html.twig file is not being loaded. I have tried to change ownership/permission of the files, but it didn't help. I turned on twig_debug and getting:

<!-- THEME DEBUG -->
<!-- CALL: _theme('html') -->
<!-- FILE NAME SUGGESTIONS:
   * html--front.html.twig
   * html--node.html.twig
   x html.html.twig
-->
<!-- BEGIN OUTPUT from 'core/modules/system/templates/html.html.twig' -->

which, I assume means it is loading default template from core/modules/system/templates/.

Here is the content of my html.html.twig:

{#
/**
 * @file
 * basic html structure of a single Drupal page.
 */
 #}

 <!doctype html>
 <html lang="en">
 <head {{ html_attributes }}>
   <title>{{ head_title }}</title>
   {{ page.head }}
   {{ page.styles }}
   {{ page.scripts }}
</head>
<body {{ attributes }}>
    {{ page_top }}
    {{ page.content }}
    {{ page_bottom }}
    {{ page.scripts('footer') }}
</body>
</html>

What might I be missing? let me know if you need more info.
Thanks


texts: Cannot assign roles creating User through REST endpoint

texts:
Sidenote, already seen this page, doesn't seem to help: How to create user with role(s) through REST service?

I've setup a new endpoint on my platform to try to allow a 3rd party to create users on the site, I've connected it up and I'm testing it out through a REST client on Firefox. So far it seems to be working fine with the exception of applying the role to the new account.

According to the link pasted above, it needs to be set to:

{
  "name": "rest_user_1",
  "mail": "rest_user_1@test.com",
  "pass": "abc123",
  "status": "1",
  "roles": [
    "5",
    "6"
  ]
}

But that doesn't work, I've got the debugger enabled, and I can see from the response it seems to be coming back with this

Array
(
    [0] => Array
        (
            [name] => rest_user_1
            [mail] => rest_user_1@test.com
            [pass] => abc123
            [status] => 1
            [roles] => Array
                (
                    [0] => 5
                    [1] => 6
                )

        )

)

To me it looks like it's assigning the role IDs (5/6) as the values in an array, rather than the keys, so instead I tried writing my body in a different way:

My body at the moment is:

{
  "name": "rest_user_2",
  "mail": "rest_user_2@test.com",
  "pass": "abc123",
  "status": "1",
  "roles": {
    "5": "Role 1",
    "6": "Role 2"
  }
}

And the response in the log messages looks like:

Array
(
    [0] => Array
        (
            [name] => rest_user_2
            [mail] => rest_user_2@test.com
            [pass] => abc123
            [status] => 1
            [roles] => Array
                (
                    [5] => Role 1
                    [6] => Role 2
                )

        )

)

Which looks like exactly what I'd expect, but yet, still it hasn't applied the roles to my account. Can anyone help?


texts:
Just started learning a more about open atrium.

Is there a way to securely share streaming videos on open atrium?

If so would this involve utilizing a contrib module?


texts: How to load Ubercart orders for certain user ID?

texts:
How to load Ubercart orders for certain user ID programatically?

There is only uc_order_history() which returns formatted order table and does not work in that case.


texts:
I would like to add javascript on logout. I tried using hook_user_logout but the javascript doesn't get added.

Even adding something as simple as drupal_set_message doesn't result in a message  being displayed.

I know the hook is firing because I can add a watchdog message in the hook and see it in the logs. The watchdog message is about the only thing I tried that DID work.
Curious about other options that may or may not have results, I tried looking at Actions and Triggers and Rules. I basically decided to try to do something simple on logout, like add a message. But even those modules don't work! I was actually really suprised when Rules didn't work.

I can add messages and do actions elsewhere. Has anyone else had problems with hook_user_logout? And does anyone know if it is possible to add javascript with that hook?

Is this some sort of problem involving drupal_goto? Hmmm.
I am on the verge of just adding JQuery to every page to check every link to see if it is a logout link and then adding a click event. It will work for my purposes, but it is such a hack. I would prefer not to.


texts: Does hook_node_info() have to be in .module or can it be in .install?

texts:
due to some code sharing it would help me quite a bit if I could put hook_node_info() to a .install file instead of a .module file. Now, from what I've tested it doesn't seem that it could be a problem but then every tutorial says you have to put it in .module file.

And the official documentation is silent in regards to this problem. So my question is, can I do it without braking something?


texts:
I'd like to know if it is possible to create a link only if a certain condition is respected.
Example with my current menu:

function mymodule_menu() {
  $items = array();
  $items['mycontent/%my_object/my_place'] = array(
     ---(code)---
  );
  return $items;
}

The link created by this menu should not be available for each instance of my_object. This menu should only be used by objects that have for example $my_object->flag set to TRUE.

In my page callback I could check the object and exit the form if the flag is not set, however the link would be still displayed and people could click on it.

Do you have any idea ? Thank you.


texts: how to count the results from the exposed filter

texts: I have created the content type named candidate_profile, included fields like candidate_name, current_position_description, location , Current_Salary_Range, New_Business_Achievements and Categories_ of_Experience and I have created a view named display_candidate and also I am using better-exposed filter  for current_salary_range field hence how should I proceed to count the results from the exposed filter...?


texts: How to access backbone model from custom javascript outside of view

texts:
I was wondering if there is a way to access backbone model variable outside the scope of the backbone model/view.This is the backbone model:
function (Backbone, Drupal) {
  Drupal.addToCart.AddToCartModel = Backbone.Model.extend({
    defaults: {
      defaultVariation: '',
      selectedVariation: '',
      attributes: {},
      renderedAttributes: {},
      injectedFields: {},
      variations: {},
      variationCount: 0,
      quantity: 1,
      unit_box: 1,
      type: 'commerce_product_variation_attributes'
    },
    initialize: function initialize() {
      this.set('variationCount', Object.keys(this.get('variations')).length);
      this.set('selectedVariation', this.getVariation(this.get('defaultVariation')));
    },
    // ... some getter and setter
  });
})(Backbone, Drupal);

And this is the view:
(function ($, Backbone, _, Drupal) {
  Drupal.addToCart.AddToCartView = Backbone.View.extend({
    initialize: function initialize() {
      var _this = this;

      var defaultVariation = this.model.getVariation(this.model.getDefaultVariation());
      _.each(this.model.getAttributes(), function (attribute, i) {
        var attributeFieldName = 'attribute_' + attribute.id;
        if (defaultVariation.hasOwnProperty(attributeFieldName)) {
          _this.selectedAttributes[attributeFieldName] = defaultVariation[attributeFieldName];
        }
      });
      this.render();
    },

    events: {
      'click .form-submit': 'addToCart',
      'change .attribute-widgets input[type="radio"]': 'onAttributeChange',
      'change .attribute-widgets select': 'onAttributeChange',
      'change .variations-select select': 'onVariationTitleChange',
    },
    // ... events on...
    onAttributeChange: function onAttributeChange(event) {
      Drupal.detachBehaviors();
      this.selectedAttributes[event.target.name] = event.target.value;
      var selectedVariation = this.model.getResolvedVariation(this.selectedAttributes);
      this.model.setSelectedVariation(selectedVariation.uuid);
      var injectedFields = this.model.getInjectedFieldsForVariation(selectedVariation.uuid);
      Object.values(injectedFields).map(function (injectedField) {
        $('.' + injectedField.class).html(injectedField.output);
      });
      Drupal.attachBehaviors();

      $('.banner.wishlist').click(function () {
        $.ajax({
          url: Drupal.url('wishlistupdate'),

          method: 'POST',
          data: JSON.stringify([{
              'variation': $(this).attr('data-variation')
            }]),
          contentType: 'application/json;',
          dataType: 'json'
        }).done(function (data) {
          // <--- HERE IS WHERE I WANT TO ACCESS BACKBONE MODEL TO ALTER SOME PROPERTIES
      });
     });
    },
// ... some other events subscribers
});
  Drupal.addToCart.AddToCartView.prototype.selectedAttributes = {};
})(jQuery, Backbone, _, Drupal);

And this is the theme settings:
(function ($, _, Drupal, drupalSettings) {
  Drupal.theme.addToCartButton = function () {
    return drupalSettings.theme.commerce_cart_flyout_add_to_cart_button;
  };
  //... some other themes functions
  Drupal.theme.addToCartVariationSelect = function (_) {
    return function (args) {
      var template = _.template(drupalSettings.theme.commerce_cart_flyout_add_to_cart_variation_select);
      return template(args);
    };
  }(_);

  Drupal.addToCart = {};
  Drupal.behaviors.addToCart = {
    attach: function attach(context) {
      $(context).find('[data-product]').once('flyout-add-to-cart').each(function (k, el) {
        var model = new Drupal.addToCart.AddToCartModel(drupalSettings.addToCart[el.dataset.product]);
        new Drupal.addToCart.AddToCartView({ el: el, model: model });
      });
    }
  };
})(jQuery, _, Drupal, drupalSettings);

What I want is to access backbone model variables on ajax done method, but I didn't find a way to do it.


texts: D7 Views: content associated with a user via tags

texts:
I want to display a View of all content relevant to the logged in user based on tags that are defined in a node referenced by the user. Something that follows this relationship:

Logged in User --(references)--> Customer Subscription -(shares tags with)-> Content

The view should show all the Content associated with the user based on this logic.
I prefer to do this via modules and not code.

Any ideas?
Thanks!


texts: How to programmatically duplicate a node?

texts:
I'm looking to create a copy of a webform I've made, with a new email address as the recipient.

After I load the node with node_load, can I just save it with node_save?  Will that create a new node with new timestamps and ids?

How can I get the nid of the new node that has been created?


texts: How to list all the user's "member for" via "Views"?

texts:
In Drupal 8, there is a "member for" in the profile page to show that how long time since this user be a member until now.

I would like to list all the user's "member for" via Views. However there is no such variable in the Views FIELDS.

I was thinking create a user field called "member since" and then every day get the "member for" value (which in the profile already) everyday, and display this "member since" field via Views. However:

I don't know how to get the value of existed "member for" variable in Drupal 8 for created user field "member since". (of course I can calculate it by myself, but I don't want to deal the timestamp, formation etc)
I don't know how to run this function to get the value of existed "member for" variable one time everyday.

Or is there a better way to do it (Note I need to use Views to display it)?

Thanks!


texts: Point visitors to directory depending on Drupal site visited

texts:
I am in the process of completing a transition from my client's old sites to a Drupal installation with multiple sites (this is my first experience with Drupal). Some of their older migrated content contains links to files available for download, which were previously located at an address in a format like firstsite.com/files/foo.zip.

They are insistent that these links not be changed, but since all of their sites are now in the same installation and there is overlap between file names (multiple sites may have a foo.zip to download), they cannot simply put all of their files in a /files subdirectory of the root (as these links would deliver a visitor to).

Is there a way I could deliver incoming requests for /files to the public files directory of each site? For example, if firstsite.com/files/foo.zip is requested, take them to /sites/firstsite.com/files/foo.zip?

I have attempted using .htaccess matched redirects but these apply universally and I cannot seem to capture the part of the request that precedes /files/foo.zip, and am not familiar enough with RewriteCond/RewriteRule pairs to build a working set for each site. Does Drupal have inbuilt functionality for this kind of legacy adaptation, or are there specific .htaccess rules that are suited to this procedure?


texts: Using a View as a filter criteria to another view

texts: How can I a view as is one of filter criteria for another view, So that it provides a list of possible options?


texts: Get link for same page in different language

texts:
I want to display a link to the spanish version of a page in my template, but another module is removing the language option on my link function:

l('Visit this page in Spanish', "node/{$node->nid}", array( 'language'=>'es' ));

I have the general routing set up the way I want; most of the time I want links to target the current language.  Except this time - now I really want that link in spanish : )

How do I force l() to keep the language I specify?  Or should I use another function?


texts:
I am new to Drupal and setting up my first site. I am keeping it fairly basic and have not added on much. I am able to embed uploaded videos without any problem, but when I attempt to embed a remote video in an article, the video does not show, instead it shows the word 'media'. I have tried uploading the video through the Content -> Media and also during the creation of the article. I have tried embedding a youtube video and a vimeo video and they both respond the same way. I wonder if the cause of the problem is that the max_width and max_height are both set to 0, if so, I have not seen any place that I can change that.

Media

Here is a link to the page that I pulled the code from, http://www.boundlessmotion.com/online/node/8

Any help is appreciated.


texts: How to print a taxonomy term's field value alongside a Views grouping header?

texts:
In Drupal 8.4.4 I have a "Living Things" taxonomy vocabulary. One field on the terms in the vocabulary is "Most Common Name", with machine name field_most_common_name. On my "Animalia" term its value would be "Animal".

In Views, I have a "Taxon Media" view which lists media related to the taxonomy term. I display it in a block on the taxonomy term's pages themselves (not on nodes). In the view I group media by another field, "Primary Taxon", which is a reference to the term. It prints on the page as the grouping heading (e.g. "Animalia").

How can I print the value of my "Most Common Name" field next to that title? i.e. "Animalia Animal".

I have made a template, views-view-grouping--taxon-media.html.twig, cloned from the one in the Classy template, tested that works, then added the 4th line and tried a few other things such as content.field_most_common_name, but cannot get the field's value to display:

    {{ title }}
    {{ field_most_common_name }}

{{ content }}


texts: Error messages not appearing inside of modal

texts:
I have a registration form showing up in a Bootstrap modal.  I attached a validation function like so, which appears to be working, but when the page reloads, the error messages which I hope would appear in the $messages variable do not appear. When I reload the page (and resubmit the form), they do.

Here is the form_alter function snippet:

if($form_id == 'user_register_form'){
    $form['#validate'][] = 'form_styling_js_validation';

}

and that validation function looks like the following:

function form_styling_js_validation(&$form, &$form_state){
if(form_get_errors()){

$form_state['rebuild'] = TRUE;
drupal_add_js('
  jQuery(document).ready(function () {
      jQuery( "#modal" ).modal( \'show\' );
      console.log(\'You failed validation!  Try again\');
    });', 'inline');
  }else{
    drupal_goto("introduction", array('query' => array('login' => 'success')));
  }
}

So, if there are errors, it injects that Javascript which opens up the modal. This is where a user should see all the error messages (e.g. "Password is required").

Here is the snippet of page.tpl.php where the modal lives:

Welcome. You'll need an account to continue.

Accounts are free and easy to set up.  Simply fill out the information below to get started

Sign in

                <?php print drupal_render(drupal_get_form("user_login"));?>
                I can't sign in or I forgot my password

Create Account

                <?php if (!empty($messages)): ?>

                      <?php print render($messages); ?>

                <?php endif; ?>
                <?php print drupal_render(drupal_get_form("user_register_form")); ?>

What am I missing here? This validation is not happening via AJAX; I believe the page is reloading, and that $messages variable should not be empty.

Thanks for any help you could provide.


texts: Uncaught PHP Exception: Query tagged for node access but there is no node table, specify the base_table using meta data

texts:
Can anyone give me a hint where this error could come from?

When a user tries to access a specific node in the login-area of my Drupal 8 website, he randomly gets a white screen with the message "The website encountered an unexpected error. Please try again later."

I look at the apache error logs on the server and see the following error message:

  Uncaught PHP Exception Exception: "Query tagged for node access but there is no node table, specify the base_table using meta data." at /mywebsite.com/html_d8tst/core/modules/node/node.module line 1107, referer: http://mywebsite.com/user/251

node.module line 1107 says:

// Bail out if the base table is missing.
if (!$base_table) {
  throw new Exception(t('Query tagged for node access but there is no node table, specify the base_table using meta data.'));
}

I don't understand what exactly goes wrong when the error occurs. And unfortunately, I don't even see any pattern in which use cases the error occurs.

It's only on this specific node. Sometimes it works, sometimes not. The node is of a specific content type which only logged-in users have access to. It contains several views, some of them are user-specific.

This https://www.drupal.org/project/drupal/issues/2664748 seemed to be a similar problem, but the post was about Drupal 8.0.x-dev and was fixed. I'm working with Drupal 8.6.13

I would be glad of any hints!


texts: Is it possible to use a view as a field in another view?

texts:
I have two views. First one is an unformatted view from a content type, and second one is a table view of most viewed from the same content type. Now I want to show both of these views in a page without using panel module. Is there any way to attach these views?
thanks.


texts: Is there a module or method for processing and generating codes for music download cards?

texts:
I'm looking for an easy way to add download card functionality to my Drupal 7/ubercart site.

In case you are wondering, by "Download Card" I mean an actual physical object that a band can sell at a gig. The card has a code on it and a URL. The buyer goes to the URL, enters the code and they are allowed to download MP3 files, etc.

There are plenty of pay options for this (CDBaby, Dropcards...) but a Drupal option would be fantastic. The Drupal site would need to both generate the codes and export them into a spreadsheet or similar so that we could print them out on to cards. The site would, of course, also have to be able accept the codes and only allow users with the correct codes to download their music.

Does something like this exist for Drupal?


texts: Is it possible to do a drush sql-sync of only certain tables?

texts:
I have 4 environments between my local, dev, staging, and production.

A large amount of content is published to the staging environment on a daily basis, so that is the center of my workflow. Once content is QA'ed in staging it is then sql-sync'ed to production. This works fine at the moment. However, we're now going to allow for user registration/user generated content. Is there a way to push these content updates with sql-sync and never overwrite certain tables? Even more specifically, is there something I can place in drushrc.php that will always skip a list of tables across all environments?


texts: "public://" is not resolved correctly to the full path

texts:
In my script, public:// resolves to http://./sites/default/files/test.txt

This is the code I used to get the actual value for public://:

$path = file_create_url('public://test.txt');

$GLOBALS['base_url'] is also resolving to http://.

Any idea why the domain is missing from the public://?

Thanks


texts: How to make Json feed not have quotes around numbers

texts:
I need the id not to have quotes around it when it is a feed from a view. How do I modify that?

For example, I want it to be
"id":5
insted of
"id":"5"


texts:
I have a module to import nodes with a date/time field. All times are correctly written into the database. But when I view a node or in node/edit I get the time +1 h.
In Drupal I have set the timezone to Berlin, which is GMT +1 h. When I change the timezone, the time in node/view/edit is not changing.

I don't know what to do to see the correct times in nodes.


texts: How do I place content in a user-profile.tpl.php, based on whether a boolean field is true?

texts:
I am trying to display certain content in the user profile pages of a site based on whether my boolean field 'member' is true. I am currently trying to solve this with an if statement like so.

    if ($user_profile['field_member']['und']['0']['value'] == '1') {

        print ('
This is working
');

    }

However this is returning an

'Undefined index: und in include()'

error on the if statement line. I'm not very well versed in working with drupal template files and would appreciate any help.

EDIT: The syntax was incorrect I should of written '#items' instead of 'und'. I discovered this with advisement, through the use of the devel kpr() function which allowed me to view the array contents more easily than a var dump.


texts: How do I change the views handler type for a field from string to int?

texts:
I'm using Views 3 on Drupal 7 with the Computed Field module.  My Computed Field calculates an int, and it is stored in the DB as an int, but Views is using the string handler by default.
How can I change the handler for one specific field from string to int?
This is the code I'm using in a custom module in mymodule.views.inc.
function mymodule_views_data_alter(&$data) {
  dpm($data);
  $data['user']['field_my_custom_field']['field']['handler'] = 'views_handler_field_numeric';
}

However, in my view, the filter choices are still:

Is equal to
Is not equal to
Contains
Contains any word
Starts with
etc.

These are the string options; I need them to be the choices for int (greater than, less than, etc.)


texts: Updating a field programmatically, hook_node_update

texts:
Currently trying to update a field every time a node is created or updated. However the value is not being populated within the node, do I have access to the node object with this particular hook? What could I be missing?

  function vbtoken_node_update($node) {

      entity_get_controller('node')->resetCache(array($node->nid));

      $types = node_type_get_types(); //What are the current Node Content Types?
      $yes = ($types['volunteer_project']->type);

      if($node->type === $yes){

        $hash = md5($node->title . $node->nid . $node->nid);
        $hashed = substr($hash, 0, 6);
        $node = node_load($node->nid);
        $node->tcode[$node->language][0]['value'] = $hashed;
        node_save($node);

        watchdog('vbtoken', 'Added a new Token code to %nid', array('%nid' => $node->nid));

        }
        else
        {
          dpm('not working dude');
        }

    }


texts: Drush finding 3rd party module but can't install

texts:
Have moneyscripts modules installed and drush does not update these 3rd party scripts but still I get a notification via drupal that update is required.

So I used drush up command but failed to update saying could not find download. Then I manually wget install the update but now if I drush up after manual install it won't stop trying to update the core.

How can I make drush IGNORE moneyscripts considering it can't install them anyway?

Or do I just have to select no everytime it asks?


texts:
I've created a views block, which contains a list of same node types. The block is placed within another node on my page "home >> blockpage". When you now follow some link in the block view you will get a breadcrumb like "home >> pageFromBlock".
How to achieve a breadcrumb like "home >> blockpage >> pageFromBlock".

I am using drupal 7 with breadcrumb module and views.


texts:
My D7 customer uses the Workbench suite of modules to use taxonomy to allow fine-grained access to nodes successfully. But with a large amount of data to manage, sometimes they want to unpublish a node for the time being while keeping the data available in case they want to publish again. In Workbench, I've set up an "Archived" option which successfully renders that content unavailable to anonymous users. So when anonymous users visit that node, workbench, using hook_node_access() renders that node to NODE_ACCESS_DENY and it appears Drupal takes over and redirects the user to /user. That's good, but the customer wants to redirect back to root if they are anonymous.
I thought about modifying Workbench using their API but it seems to be after stepping through how Drupal handles the menu_execute_handler() that the redirection to /user occurs. I need workbench to return the DENY so I can use that as one condition to dynamically alter how Drupal renders the view in a DENY situation. But I haven't found which part of core handles this redirection.
Hunting through searches I found this suggestion which suggests to handle all 403s.

function my_module_menu() {
  $items['403redirect'] = array(
    'page callback' => 'mymodule_unpublished_redirect',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
    );
return $items;
}

function mymodule_unpublished_redirect() {
    if (<TRUE>) {
        header('location:'. url('/', array('absolute' => TRUE)), TRUE, 302);
    }
}

But when visiting the node that is "Archived" redirects to /user which suggests that this function is ignored at this point. So how should I alter this redirect?


texts: group same fields in views using custom template

texts: drupal 6 user here. I am sure that this is basic views question but I can not figure answer to it. I have a simple view with 2 fields - node title (field_title) and node author (field_author). I want to print all data separate so that node titles would be printed inside ONE single separate div and node authors would be printed in another div. This can not be achieved using rewrite option as far as I know. Can anybody help me with this? Thank you.


texts: Is it possible to create a view of Nodequeues

texts: I'm trying to create a list of all my nodequeues using Views, To be clear I'm not trying to create a view that showing the content within a Nodequeues, but rather create a views that lists the Nodequeues themselves is this possible? if so how do do it?


texts: How to add directions with a link to a webform in Drupal 7

texts:
I'm creating forms with the webform module. I'd like to add 'directions for filling out the form at the top of the form. I'd like those directions to include a link to another form if users clicked the wrong form.

This seems like it should be simple to do, but I can't figure out how to do it. When I add the directions with the link in a  and put that at the top I get the link but no paragraphs, just one long running line of text, no matter how I split it up in the editor window. If I use a  field, not only does it look ugly (even when disabled), because it has a white background on a gray background site, but it displays the link as html code etc..

I have wysiwyg enabled on my site and it shows up in other places but not on these editor windows so I can't use that (or select filtered html/full as those options also aren't available) in those data types I tried.

Anyone know a way to do this?


texts: Save and set an external link image programatically

texts:
I have a field that will accept an image link coming from the external source. But of course, to set that image I have to save it in Drupal first. I'm wondering how do Drupal save the image from an external link. I use the following code.

$imageUri = 'https://api.statvoo.com/favicon/?url=google.com'; // this is a favicon

$file = File::create([
          'uri' => $imageUri,
          'status' => 1,
        ]);
$file->save();

$user_profile->field_profile_image[] = [
        'target_id' => $file->id(),
        'alt' => 'Alt text',
        'title' => 'Title',
        'width' => 200,
        'height' => 200,
      ];

$user_profile->save();

I notice that the following values and the external image URL were added in the image field, but the image is not displayed on the page. Thanks in advance!


texts: Views will display entities the user does not have "view" access permission

texts:
I have a custom entity type that can be viewed by certain people only. This works just fine, when people go to "mysite.com/custom-entity/8" some can see the info, some get "access denied" error.
The problem is I created a view to display a list of those entities and all of them are shown to all users, even if certain users shouldn't have "view" access permission.
LE: Caching is set to "None"
Any ideas on how to fix this? Thanks.


texts: How do I modify and then render the Drupal login form in a page template in Drupal 7?

texts:
I'm working on building a custom Drupal 7 theme using bootstrap. One of the things I want to achieve is a login form that is part of the standard page template, rather than sitting alone on its own login page.

Much like on pages like this, for example, where if you are not logged in, the login form sits on each page so you can log in directly from there.

I also need to modify the rendered form to use bootstrap containers and classes, so instead of just rendering the standard form, I need to wrap the form elements in divs with "col-md-4" etc classes.

Can anyone advise or direct me to any documentation on how to achieve this. I'm sure you know that for a beginner, Drupal can be very confusing!


texts: Why would content in Body field Edit mode differ from View mode (Language issue?)

texts:
We are using the Lingotek translation service for our Drupal 7 site, and have experienced the following very similar problems.

Case 1: Content types - Monthly Product Update AND Blog post

Server1
- Behaving
- Language setting: English (as seen in Content listing)
- Enabled for translation: No, then No

Server2
- Misbehaving
- Language setting: Language Neutral (as seen in Content listing), changed to English
- Enabled for translation: No, then Yes

Server3
- Misbehaving
- Language setting: Language Neutral (as seen in Content listing), changed to English
- Enabled for translation: No, then Yes

Consistently, for Server2 and Server3, for this Content Type, I enabled Multilingual support, then in the node, changed the Language to English.

The Misbehavior: This node initially displayed all of the content in View mode, but nothing in Edit mode. Changing its multilingual setting AND changing the language to English resulted in the following:

What was previously displayed in the Edit mode (nothing) became the display in the View mode, i.e. nothing. The content was lost entirely.

From another instance of the site, I copied the source for this post and pasted it into the Body field and saved it... The node now displays in both Edit and View mode as expected, and further edits have been reflected appropriately.

Case 2: Content type - Product Page

Server2
- Misbehaving
- Language setting: Language Neutral (as seen in Node and Content listing), changed to English
- Enabled for translation: Yes

The Misbehavior: Complaint from editor that edits made, additional text added to Body field, are displaying in View mode, but not Edit mode - which I verified.

Aside: I used Node Export to export ALL the code for this node and checked it for the missing content and it was NOT there.

In View mode, I copied the HTML with the edits and pasted it into the Source for the Body field, which made the View and Edit modes sync up. However, I did not change the Language setting at this time.

The following day, the editor complained that her edits were visible in Edit mode, but not in View mode...

This time, since there was nothing else I could think of to do, I copied her source code for safe keeping, and then changed the Language setting from Language neutral to English... this actually reverted the Source/Edit code to match the View code - which did not have the latest edits!

However, now that the Language was set to English, I pasted in the saved Source code and THEN... the Edit and View modes matched up, AND further edits have been reflected appropriately.


texts: how to use custom block variables area in theme block

texts:
I installed the module "theme block". there is an area called "custom block variables". Does anyone know what is it and how to use it? I would like to create a custom block to see a portion of an article that I wrote and I want see a picture. It can serve me?
Thank you.


texts: 8 - Is there a drush command to reset a module's config back to install defaults?

texts: I'm working on a custom module in Drupal 8 and have nested the config a bit, but getting errors and want to just reset the config for that module completely.


texts: DAMP / Aquia Dev (mac) apache fails on import of drupal core 7

texts:
I'm attempting to switch from Bitnami to Aquia Dev Desktop for the mac (OS 10.8.2). I'd like to be able to develop a couple sites (using core drupal - not the aquia distro) simultaneously in a reliable environment.

Ran the uninstaller on Bitnami and checked that all files were
deleted.
I successfully installed Aquia Dev Desktop, saw that Apache and
MySQL servers were both running, and got the local Aquia Drupal site
when I clicked "Go to my site" in the control panel. So everything
was working fine.
Downloaded Drupal 7 to a folder on my desktop, decompressed, renamed the drupal
folder to my site name (all lower case and no special characters),
and reset the folder permissions to "Read & Write" and applied to
all enclosed folders.
I attempted to import into Aquia Dev Desktop but got "Error -
Process 'Apache Web Server' failed to start".

I tried using the settings panel in Aquia Dev Desktop to reset port from 8082 to 8080 but apache still won't start.  Tried a few other port numbers and no luck.

Here's the complete Apache error log:

  [Fri Apr 05 15:05:54 2013] [notice] Apache/2.2.23 (Unix) PHP/5.2.17
  configured -- resuming normal operations [Fri Apr 05 15:06:37
  2013] [notice] caught SIGTERM, shutting down [Fri Apr 05 15:06:43
  2013] [notice] Apache/2.2.23 (Unix) PHP/5.3.18 configured -- resuming
  normal operations [Fri Apr 05 15:16:41 2013] [notice] caught
  SIGTERM, shutting down

I have very little experience with server administration or apache configuration.

Can anyone point me in the right direction?


texts: Change Comment Text Format in phpmyadmin

texts:
Hello i seem to hav changed the text format for my comments and now all my old comments cannot be seen. When i edit the comment the text format select list has no default value. I would like to give all my old comments the 'plain text' value. Thanks

Something that helped me sort the node body field was-

UPDATE field_data_body SET body_format = 'markdown'

Also i think it might be the  field_data_comment_body bit (plus revisions possibly) that need changed. Could anyone suggest anything for me?

Thanks


texts: Modify the page title of view and set custom title for it

texts: I am using views and drupal 7 . I pass arguments in the URL and i want this as view page title. This is possible by using override title check-box. But i want to modify this title. i.e do some formatting and some trim of the content and show only what i require as title. how can i do it.


texts: Date module text between start and end date

texts:
I'm wondering if it's possible to change the "to"-text between a start date and an end date.

I'm only using years, for instance I want to change the following line: "1925 to 1928"
To this line "1925 - 1928".

I'm using drupal views, and this specific information is presented in a grid system.

Where can I change this?


texts: Access content at alias without redirecting to original content location

texts:
Is there a way to generate an alias for content WITHOUT having it redirect to the original content location and therefore preserve menu location?

For example - I have one node which is located at http://mysite.com/oranges but I'd also like to access it at http://mysite.com/apples WITHOUT being forwarded on to the original URL.

Is this possible? I know, from an SEO standpoint this is not ideal, but we are creating several groups of pages (sub-sites) and several of the sub-pages need to have the same content and it will be tedious to edit them one-by-one.

Is the only option here to create and embed blocks on the pages so that the content is unified?