texts: How to deal with /system/files references when upgrading to D7?

texts:
After migrating a site from D6 to D7 with drush site-upgrade, I notice that some public contents in the D6 version refered to pictures with URIs like for instance /system/files/logo.png, instead of the more efficient /sites/default/files/logo.png
There's no system directory on disk and no URL rewriting that I can see, so I assume the first form goes to Drupal for routing.

The problem is that with D7 post-upgrade, such references lead to a "Page not found" error so the pictures are broken.

As a test, if I drop somefile.png into /sites/default/files/, D6 seems to be happy to serve http://example.com/system/files/somefile.png despite the fact that the file is not known anywhere in its database. But D7 apparently doesn't do that.

Is /system/files a hardcoded path component that means something to D6 and not D7?
In /admin/config/media/file-system, the download method is set to "Public local files served..."

How to solve this with Drupal 7? Is there a configuration setting somewhere that I'm missing?


texts:
Why am I getting an error that kint is an unknown function?
When I use kint in my twig template, I get the following error:
The website encountered an unexpected error. Please try again later.

Twig\Error\SyntaxError: Unknown "kint" function. in Twig\ExpressionParser->getFunctionNodeClass() (line 96 of themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig).
Twig\ExpressionParser->getFunctionNode('kint', 96) (Line: 235)
Twig\ExpressionParser->parsePrimaryExpression() (Line: 175)
Twig\ExpressionParser->getPrimary() (Line: 70)
Twig\ExpressionParser->parseExpression() (Line: 142)
Twig\Parser->subparse(NULL, ) (Line: 98)
Twig\Parser->parse(Object) (Line: 563)
Twig\Environment->parse(Object) (Line: 595)
Twig\Environment->compileSource(Object) (Line: 408)
Twig\Environment->loadClass('__TwigTemplate_d5b278350c4def17738543ca20480b532effadcdfc825b13713ee45ee867f82b', 'themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig', NULL) (Line: 381)
Twig\Environment->loadTemplate('themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig') (Line: 65)
twig_render_template('themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 78)
Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I am using Drupal 9.0.1. and have, among other things, this in my composer.json file:
"require-dev": {
    "drupal/devel": "^4.0",
    "drupal/devel_php": "^1.2",
    "kint-php/kint": "^3.3"
}

In my services.yml file, I have:
twig.config:
  debug: true,

And in the twig file I have:
{{ kint() }}

I also have the Variables Dumper set to Kint in the Devel config.


texts:
I ve got 2  type of commerce product.1 is the product the other is another type of product commerce.
I want to check if the product type is then you can do something if not do another thing.

Notes:

I've got a 1 product type is a shipping and the other product type the option Both of them are cumulated on the commerce cart i want to to check if the product type is a shipping and the other is an option .the option on the cart i want it will be unable to remove on the cart and the shipping product can be remove to select another shipping product . i am on drupal 7 with commerce 1.
my question is to check the product type and be able to block the button remove on the cart.
only if the product type is a shipping the button can be remove on the cart.
delete-line-item btn btn-sm btn-default form-submit i want it will be removable only if the product type is a shipping.
views-view-field--commerce-cart-block--default--edit-delete.tpl.php ont this i want if the product type is a shipping the button can be remove but the other product (the options) cannot be removable.
i ve create a template from views-view-field--commerce-cart-block--default--edit-delete.tpl.php and  but i don t know how to set this button enable only if the product type is a shipping product.
(Line items referenced by commerce_line_items) Commerce Line Item : suppress button.


texts: Can drush show list all available modules?

texts:
With yum you can do yum list available ..., and know the name of the package you want to install.

For example, there is the Mime Mail module in Drupal. What name should I use with drush dl, mime_mail, or mimemail?

So does drush have something like yum list available?


texts: comment pager not showing in bootsrap theme

texts:
I create a new theme based on Bootsrap and the below template files, I limit  show comment on every page on 50 comment in edit of content type in comment section, I have 126 comment in one of my node form that content type, but only see 50 comment and there is not any pager.

My question is that how can I add comment pager in below of comment?**

comment-wrapper.tpl.php

    <div id="comments" class="<?php print $classes; ?>"<?php print $attributes; ?>>
      <?php if ($content['comments'] && $node->type != 'forum'): ?>
        <?php print render($title_prefix); ?>

<?php print t('Comments'); ?>

        <?php print render($title_suffix); ?>
      <?php endif; ?>

      <?php print render($content['comments']); ?>
      <?php if ($content['comment_form']): ?>

<?php print t('Add new comment'); ?>

        <?php print render($content['comment_form']); ?>
      <?php endif; ?>

and    comment.tpl.php

<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>

    <?php print $picture; ?>

        <?php print $author; ?>

        <?php print $created; ?>

        <?php print $permalink; ?>

    <?php if ($new): ?>
      <?php print $new; ?>
    <?php endif; ?>

    <?php print render($title_prefix); ?>
    <h3<?php print $title_attributes; ?>><?php print $title; ?>

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

    <div class="content"<?php print $content_attributes; ?>>
      <?php
        // We hide the comments and links now so that we can render them later.
        hide($content['links']);
        print render($content);
      ?>
      <?php if ($signature): ?>

        <?php print $signature; ?>

      <?php endif; ?>

    <?php print render($content['links']); ?>

Any idea?


texts: How I do configure the BigBlueButton module?

texts: I have installed the BigBlueButton module. Its demo is working fine. How do I create a meeting?


texts: Swap columns inside every other row with Views and Bootstrap

texts:
i want to create block with views.I want style output like image bellow.
Sorry i add  image because my english is not good and i cant explain what i want


texts:
I have create a website that, on the same page, will offer several links to the exact same section (node).
For example the link to the "Contact us" node appears 3 different times (in 3 different places) on the home page.

Is there any way to track each click separately and to know which links were clicked to reach the contact us page?

I am already using the "Google Analytics" Drupal module, but the same link is tracked as a single unit, regardless of the number of times it appears on a page.


texts:
I have a php file in my Drupal 8 module.The name of my custom module is fb. Within the fb folder I have a php file fb.php .The content of that file is loaded as an iframe using the follwing code
  public function buildForm(array $form, FormStateInterface $form_state) {
  $extpath = take_control_fb_ext_client_path();
  $fbpath = take_control_client_path(drupal_get_path('module', 'fb') . '/fb.php?extpath=' . $extpath);
  global $base_url;
  $form['#attached']['take_Control_fb']['library'][] = 'fb/fb';
      $form = array(
      'take_control_fb_container' => [
    '#type' => 'inline_template',
    '#template' => '',
    '#context' => [
      'url' => '/modules/fb/fb.php?extpath=/libraries/extjs/ext-3.4.1'
  ],
],
  );
return $form;
  }

.I need to check drupal login is set or not in the fb.php file.  I have used the following code to check that

$logged_in = \Drupal::currentUser()->isAuthenticated();

Ref link : https://docs.acquia.com/articles/there-drupal-function-check-if-user-logged

But it resulted the error 'PHP Fatal error:  Class 'Drupal' not found'.

Please help me to figure out some solution to fix this.


texts: Billing and shipping mismatch on some orders

texts:
I just recently getting billing and shipping mismatch on some orders which in turn  affects shipping rates. On below transaction shipping rates get billed for Afghanistan, but address details are for USA. Payments go through to Paypal which then need to be refunded due to the mismatch in Countries.

Having a look in the database I get 4 entries for this order, 2 shipping and two billing.

At Home » Administration » Store » Orders >> order number I see this:

Billing information:
A. Customer
Afghanistan

Shipping information:
A. Customer
1234 Wild Trail
Chocolate, OH 44233
United States

Any advise on how to trouble shoot this? Thanks for your input.


texts: Pathauto unable to bulk update contents alias with AJAX error

texts:
In some way I have imported a legacy large database schema to Drupal's database schema. Everything works fine and the imported contents is working fine as nodes.

However, when I try to perform Bulk Update for aliases via admin/config/search/path/update_bulk, using pathauto module, I got the following error message after about 4825 items :

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /drupal/batch?render=overlay&id=1074&op=do StatusText: Service unavailable (with message) ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7844 of /xxxxx/drupal/includes/common.inc).

The following is a screen shot:

Clicking on the link titled Please continue to the error Page just send me to the bulk Update page with error message:

An error occurred while processing pathauto_bulk_update_batch_process with arguments : pathauto_bulk_update_batch_process

I could not able to find more detailed debug info and I don't know what's the matter?

Last version of Pathauto is used.


texts:
I statically linked an anchor to my /cart page on page.tpl.php, but since it's a multi language website, when I'm on http://localhost/fr it still goes to http://localhost/cart instead of http://localhost/fr/cart

I'd like to know how to print the current base language path or base_url and concatenate it with /cart

thanks.


texts:
I have created a View on my /blog/ page for displaying blog articles. For layout reasons this view is in a block.

This view has a contextual filter for Taxonomy tid on node and, since it is a block, it has a default value of Taxonomy Term ID from URL. When I enter tids in the preview box it works.

However, how do I format this in the url? /blog/1 /blog/term/1 and /blog?tid=1 all return 404 pages. How do I put the tid in the url?


texts: Frontpage module redirecting to /user/uid not correct url on login

texts: The frontpage module redirects to /user/uid on login, not the specified redirect URL. All config looks correct. I have all redirects set to node/1 which is where I want it to redirect.


texts: How can we synchronize Nodes from Staging to Production Server

texts:
My Question is there any way we can track the node changes on Staging Server and Push the same to the Production Server. Best use case will be,

Customer does not want to change the content on Production server.
He wants to first change on Staging server get it tested and push the content to live server.
Have revisions for changes so that he can revert back any time using node re- visioning system !

Can we do this maintaining the node id's same across staging and live servers ? Is there any out of the box solution for this like feature module does for configuration changes tracked using modules?


texts:
When I'm editing a view and I click on one of the fields to edit them I get a javascript error

Error: TypeError: c.curCSS is not a function
Source File: http://drupal.mydomainname.ca/misc/ui/jquery.ui.position.min.js?v=1.8.7
Line: 13

When I click Apply or Cancel on the configuration dialog I get taken to a page with nothing but a JSON string on it at this url

http://drupal.mydomainname.ca/admin/structure/views/ajax/config-item/home_page_slider/block/field/field_image

Anyone else have this error or know what might cause it?


texts: Content type biasing in Apache solr module for single content type

texts:
I am working on displaying the search result using solr search and apache solr module in D7.

I have few content types let's say Article, Blog, Video, News, Story, Page etc.

I have given weight to each content type from Type Bias section of apache solr.

But, now I want to display the news as "latest news first" if it comes in the result. I tried it by using Result biasing section "More recently created" and have given the weight there. But it is affecting the result for all the content types, whereas I just want to display it for "News" content types. I tried to search a lot but didn't find an appropriate answer.

How can I do this?


texts:
I'm currently running Drupal 7 and have got some taxonomies setup.

I also have different content types which live under the same taxonomy terms but want to be able to filter a term by content type.

What's the best way to do this in Drupal 7? I've looked into the Views module which looks like it's the right way to go.

I've also looked at this article: http://www.braahm.be/posts/tuning-taxonomy-pages-page-manager-panels-views-and-custom-build-modes-drupal-7 and Filter by content type and shared taxonomy terms but they seem a bit over the top for what I want to achieve.

Cheers,

James


texts: adding block region inside of menu section

texts:
I have a menu section in my theme where i display the main-menu menu. This works as expected. with the following code.

<?php print theme('links', array(
                    'links'         => menu_navigation_links('main-menu'),
                    'attributes'    => array('class'=> array('navbar', 'navbar-collapse', 'collapse'))
));?>

I would like to make a block region inside of this rendered menu section for the search box. The end results will be block region at the end of the menu that i can style to be to the right of the menu. I could do this in css but was hoping to make the rendered html a little cleaner. This is what I have tried.

<?php print theme('links', array(
                'links'         => menu_navigation_links('main-menu'),
                'attributes'    => array('class'=> array('navbar', 'navbar-collapse', 'collapse')) ,
                'region'        => render($page['search']);
));?>

There looks to be no tutorials on adding a block region to the menu array. Is is possible to inject a block region into the menu render array?


texts:
Are there any reliable performance comparisons between vanilla Drupal 8 versus Drupal 7?

I have searched the web but only find the post "Drupal 7 vs Drupal 8 Performance Comparison", which is far from encouraging.


texts: How to add close caption in the MediaFront module?

texts:
I have the MediaFront module installed in my site. Thats uses OSM player to play.

I need a close caption button in OSM player.

How can I do this?


texts:
While viewing my Status report, I came across this error under the CTools CSS Cache header:

  The CTools CSS cache directory, ctools/css could not be created due to
  a misconfigured files directory. Please ensure that the files
  directory is correctly configured and that the webserver has
  permission to create directories.

How do I fix this?


texts: javascript hack added to every body field - how can I global search and replace?

texts:
In the last week it seems that all my drupal sites were hacked.  One problem I have is that a javascript was inserted at the beginning of every content body field.   Attached is an image.

I have literally hundreds of nodes with the script maliciously added.
Does anyone have a simple suggestion for how I can remove this script from all the nodes?

Note: I'm not php savvy.   Just a drupal user who has built a few web sites.

Thanks


texts: How do I stop a stuck-and-running cron job (Elysia Cron on Pantheon)?

texts:
One of my cron jobs, which are all managed by Elysia Cron and running in its default channel, is stuck and running (R).  My site is hosted by Pantheon, in case that matters.

The job in question is schedule to execute at 15 minute intervals.

What do you recommend I do to stop the stuck-and-running job?


texts: Getting image SRC with xpath - Simpletest (WebTestBase)

texts:
I am developing a Drupal 8 test which will check for a image's existence. The image will not be loaded while running the test and I want to catch that using xpath().

The HTML I am trying to search is,

  blockquote

In this HTML you can see that I need to find the SRC in the  tag. The SRC is invalid and it should be http://local/test.png. I am searching the HTML with $this->xpath('//span[@class="cke_button_icon"]/img[@src]'); but getting a blank array in return.
How can I fetch this element?


texts: How to implement POST request in custom services module?

texts:
I want to send the POST parameters from my PHP client library, for that how to make my custom services module?

function module_rest_services_resources() {
  return array(
   'new_note' => array(
         'retrieve' => array(
           'help' => 'Retrieves a note',
           'file' => array('file' => 'inc', 'module' => 'module_rest'),
           'callback' => '_module_rest_retrieve',
           'access callback' => '_module_rest_access',
           'access arguments' => array('view'),
           'access arguments append' => TRUE,
           'args' => array(
             array(
               'name' => 'id',
               'type' => 'int',
               'description' => 'The id of the note to get',
               'source' => array('path' => '0'),
               'optional' => FALSE,
             ),
           ),
         ),
     ),
  );
}

Its working with GET request, what i have to change here to process the POST?


texts:
I want to add a logo (CCK image field) to the group nodes and show it when users visit that group.
Is there any module for that?


texts:
I want to implement a feature which, if I were to enter a correct value into a entity reference field in add node, the form will automatically update its' field values to be the same as the ones of the entity I selected (I pick what's loaded to what field).

I'm aware that hook_form_alter can alter the content of the add node form (but on load of the form), but I'm unsure which hook to use that'd trigger when I enter a correct entity reference value into the field.


texts:
I have created a view to list nodes path articlesearch.

Now i want to filter the content with a search string based on title, body and taxonomy term with OR condition

One issue i am facing is i want to use only one search parameter that will be used to match to find the string in title body and tags.

e.g. http://example.com/articlesearch?s=as

Other issue is that when i expose parameter to search content from url, it will work fine for title and body. But when i use the same string to search between tags, views shows error and no content appears. Because views matches the exact taxonomy term name/term id.

Basically my requirement is:-

One search parameter that will be used to find the content from title, body and tags
Or i want to use taxonomy term name in LIKE condition so it will not show any error if exact term id/term name is not passed to it.
Or i can override the url parameter before  passed to view

I don't know how to achieve this requirement.

Help would be greatly appreciated.


texts: Filter menu_tree_all_data() tree by language?

texts:
My site uses multiple languages and I'm using menu_tree_all_data() to get the menu tree programmatically. Currently all nodes and their translated nodes use the same menu tree.

If I use a menu block the menu that is displayed is filted by language version of the site the user is on. Which is good.

When calling the menu_tree_all_data() in code to build a menu programmatically it returns the entire tree and there does not seem to be an option to filter the menu by a language.

Does anyone know how to get the menu tree in code filted for a specific language?


texts: How to grey out fields with non editable permission upon node editing?

texts:
I need the ability to grey out fields with non editable permission i.e. to show certain field values to the user but forbid him/her to edit them, upon node editing.

How can i achieve this?


texts:
In Drupal 7, you can disable user pictures just by unchecking the appropriate box on the Config -> People screen.

How can I disable user pictures in Drupal 8?  I see that the default D8 install adds an image field user_picture at /admin/config/people/accounts/fields, but I assume that it would be better to somehow disable this than just to delete it.

For now, I don't want user pictures to be shown or used in any way, unless I decide to re-enable them later.


texts:
I've recently found and started using the File Fields Path module in Drupal 7 and I have a date field that I'm only collecting the year from.  Using that in the file path part of the module, it returns the value as YYYY-MM-DD-HHMMSS.

So a value of 2017 shows up as 2017-01-01-000000 since I didn't collect any of the other information.

Is there a way to just get it to make the folder as 2017 instead of the whole date?

Thanks for any help!


texts: How can I delete old entries in locales_source

texts:
Drupal 7. I have used the t() function to translate many string in different languages. I used English as default language, and added t('This is a new string') all around my module files, template files, etc.

The problem is that I have changed the original string names several times, and in some instances, I didn't delete the "duplicate" entries, so there is garbage. Is there a way of listing or retrieving all the t() strings that I added? Maybe comparing with a fresh Drupal installation and exporting a template *.po and using a program to compare the changes ?

Thanks!!!


texts: How to customize the webform field validation message?

texts:
there is a huge issue where when a Phone number field is validated on a webform, we get the following error message:

North American Phone numbers should only contain numbers and + and - and ( and ) and spaces and be like 999-999-9999. Please enter a valid ten-digit phone number with optional extension.

In reality we need an ability to customize this and we were looking into the hook_form_alter, but we hit a snag and cannot find ways to modify the error message. How would we be able to modify the validation messages?


texts: How do I use bigdump.php with Acquia Dev Desktop?

texts:
I am trying to import a rather large database (~450MB) on my local machine (running Acquia Dev Desktop). To do this, I was going to use BigDump.

However, I must not be configuring bigdump.php correctly because I keep getting this error:

  Database connection failed due to No connection could be made because the target machine actively refused it.

Here's my database configuration in bigdump.php.

$db_server   = 'localhost';
$db_name     = 'testdb';
$db_username = 'drupaluser';
$db_password = '';

Do I have to edit something in Acquia Dev Desktop to allow connections?


texts: Custom Template for Comment based on node type

texts:
I'm trying to add a custom template file per content type for my comments. comment--[contenttype].tpl.php is not being picked up by default. I read where this may be a d7 bug or perhaps by design. Then I also read that I can add a preprocess function to my template.php, but I'm still a bit confused. I've added this to my theme;

function bartik_preprocess_comment(&$variables) {

}

but what additionally do I have to add to this function to get it to pick up the suggestions. If someone could give me the exact code for my example it would be much appreciated, assuming that my content type is called car.


texts: How can I render or change programmatically the responsive image style for an image field for a paragraph?

texts:
I want to allow the editor user to be able to select different responsive image styles to render an image field from a paragraph field. So I have defined another field where the user can select the responsive style they want.

The problem is that I can't apply that responsive style on the fly on the twig template, so I tried to altered the field or create the picture element and assign it to a variable I can access from the template in the hook_preprocess_field, but I can't access the url of the image in the variables. So I don't know how to carry on.

Is there a way to achieve this?


texts: Drush site upgrade: Contributed extensions were not upgaraded

texts:
I am using Drush site upgrade module for D6 to D7 Upgrade.

In step 15, drush asks me to update only one module i.e. path_access, and for all the modules it says "following contributed extensions were not upgaraded". Then in final step its says "there are no more modules to be upgraded".
And my all contributed modules remained unupgraded.
Should I need to upgrade them manually.


texts: multistep module to create multistep registration form

texts:
I need to use the multistep module to create a multistep registration form in Drupal 6.

In the multistep module you can easily create a multistep form for a content type but I need to use it instead of Drupal normal registration page.  How can I do this?


texts: Database Search API Programmatically error

texts:
I am trying to perform a search programmatically with our database search api (no solr or other servers) with the following code:

$query = \Drupal\search_api\Entity\Index::load('us_search')->query();
$query->keys($search_entry);
$query->setFulltextFields(['title', 'url']);
$query->range(0, 5);

$result = $query->execute();

However, when I run the code it is throwing this error:

  Search keys are given but no fulltext fields are defined.

I further check if the index itself was able to pull the fulltext fields using this code but the array is always empty

$index = \Drupal\search_api\Entity\Index::load('us_content');
$index_fields = $index->getFulltextFields();

The fields are setup correctly and the search works perfectly fine on the UI side.  It is just that I need to be able to create the search programatically for a web service but am stuck right now due to this error.

Anyone has any idea what might be missing?  Thanks


texts:
I'm learning entityfieldquery api

I wrote a simple module

function demo_menu() {
  $items = array();
  $items['demo'] = array(
    'page callback' => 'demo_list',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  return $items;
}

function demo_list() {
  $query=  new EntityFieldQuery();

  $result = $query->entityCondition('entity_type ', 'node')
    ->execute();

  print_r($result);
}

I got this error

EntityFieldQueryException: For this query an entity type must be specified. in EntityFieldQuery->propertyQuery() (line 1195 of C:\openserver\domains\drupal7.localhost\includes\entity.inc).

I read many articles. This is the most simplest query but it is not working.


texts:
I have altered #autocomplate_path for node queue autocomplete node suggestions to show image field along with title and nid, which is working fine. The code which is returns the image with title and nid is.

$matches[$node->nid] = theme('image_style', array('style_name' => $get_image_field_style, 'path' => $image_field_uri, 'attributes' => array('class' => array('nodequeue-runsheets-images'))))
              . check_plain($node->title)
              . " [nid: $id]";

This is how I see the results with the above working code: -

The problem comes when drupal autocomplete pull the selected suggestions and populate it to autocomplete textfield. I see the html tags as . How can I override this to show only node title and mid.

The problem:


texts: How can I work on which particular pages a CSS rule is used?

texts: I would like to see a list of pages where a particular style is used so I can either delete/modify it.


texts:
I have created a "button" class in my style.css file.

I can easily create a button by assigning the "button" class to it. I can do this when I write the html code in, say, a block that I place wherever on the page.

But how do I transform an existing link (like one automatically created by a module) into a button?

Do I need to hack the module?

Any help on this riddle would be greatly appreciated.

Thanks.

:)


texts: Re-write URL path before it appears to the user

texts:
I have a node with path my-awesome-node. Whenever I am accessing that node I am redirecting to a fixed path via hook_preprocess_page().

As a next step I also want to overwrite the path in the browser to show my-awesome-node. I am doing this with javascript right now, but it is still visible to the user. Is there a way to achieve this via php?


texts: One-time URL to change a user's field value

texts: How can I create a one-time URL (sent through email messages) users can use to change the value of a custom field?


texts: Migrate products, orders, users, attributes, and options from Ubercart 2 to Ubercart 3

texts:
I am working on a new Drupal 7 site to replace a Drupal 6 site that was badly compromised. I have built the D7 site from scratch, and I now need to migrate the Ubercart products, orders, attributes, and options (as well as the users) from the D6 site to the D7 site. I found this page, but it appears to only be for migrating into Ubercart 2/D6. Can anyone here shed some light on how I can make this migration work?

One of the things I tried was exporting the individual database tables from the D6 site and importing them into the D7 site's database. It seems to have worked for the Atributes and options, but unfortunately this did not work for the products/nodes... when I view the Content listing page in the D7 admin, it shows the page at the bottom of the screen but it says I have "No content available".

Thanks!


texts:
I'm trying to get a nodes "poll" created date and how much time it has until it closes in a view.
but having a problem reaching that information for the available fields, I tried to create a relation with the content: author with no luck.


texts: Installing with Composer causes unit tests to fail

texts:
I installed with Drupal with Composer (using drupal-scaffold) with Drupal files placed inside the web directory. When I run unit tests, two of them fail because Drupal expects to find the composer.json file inside the web directory whereas in my case composer.json is in the project root (which is obvious place for it).

Is this an issue with my configuration, or is it a problem with unit tests that make wrong assumptions?

The failing tests are
Drupal\Tests\ComposerIntegrationTest::testComposerJson and Drupal\Tests\ComposerIntegrationTest::testComposerLockHash. Both fail with the following error message.

  file_get_contents(web/composer.json): failed to open stream: No such file or directory


texts: String translations not working after setting language in page preprocess function

texts:
I am using the domains module (D6) with multiple domains on a 1 site, and we have multiple languages on 1 domain. (We have to have this set up with no other option). Internationalization string translations is enabled and the translated strings in the t() function are in the database.

The domian language setting overrides the node language setting which causes the string translations not to work when having multiple languages on 1 domain.

I have overridden the domain language setting with the node language setting in the theme template_preprocess_page() function and works well but I think it happens too late in the process as the string translations still don't work.

What do I need to do to get the string translations to work?

function phptemplate_preprocess_page(&$vars, $hook) {
  global $language;

  // Reset Language to Page Node Level
  // Get the list of languages
  $languages = language_list();

  // Set up the new language code
  $new_lang_code = $vars['node']->language;

  // Make sure the required language object is actually set
  if (isset($languages[$new_lang_code])) {

    // Overwrite the global language object
    $language = $languages[$new_lang_code];
  }
  var_dump($language) // $language = node language setting
}


texts: Don't Associate Orders With Drupal Users - Guest Checkout Only

texts:
Drupal 8, Drupal Commerce

We desire a "guest only" checkout experience. We don't want to associate orders or customer profiles with Drupal user accounts.

An unauthenticated user can checkout as a guest and achieve this.

However, if a user is authenticated before they checkout their order and customer profile will be associated with their Drupal user. This is what I am trying to avoid.

Does anyone have pointers for how this might be accomplished?


texts: How can we get the list of all the tables joined or used as a base table with the views using hook_views_data()?

texts: Is there a function that can provide me a list of base tables or joined tables associated with the views, or can I check whether a table is joined with some other table using hook_views_data()?


texts: adding ckeditor color button and font size

texts:
I am new to drupal.
I am using drupal  8.2.5, bartik theme and i would like to add font size&family and colour buttons to the ckeditor.

i installed the "CKEditor Font Size and Family" module, enabled it and then at "admin-configuration-content authoring-text formats and editors" i configured "Basic HTML" and "Full HTML" and drag the new available buttons of fonts and size to the toolbar. I saved it and then when i tried to add new content (article or basic page), the editor was completely gone, there was only the field of "summary" available to write something!
When i disabled the module, the text editor was back to normal.

Later, I noticed at the module page that the installation process was the following:

Download the plugin from http://ckeditor.com/addon/font.
Place the plugin in the root libraries folder (/libraries).
Enable CKEditor Font in the Drupal admin.
Configure your WYSIWYG toolbar to include the buttons.

So I realised i hadn't followed step 2. I don't know where the libraries folder is, although i searched and have no experience how to create it correctly and how to place this plugin there.
I read various posts on the internet but couldn't find a solution and then i ended up here.
Thank you.


texts: Are there any contributed/commercial themes available for Open Atrium?

texts:
Googling "Open Atrium Theme" doesn't yield very many results. I have a sinking feeling that most people who install Open Atrium stick with Ginko for the theme.

Are there any contributed themes out there for Open Atrium or Commercial Themes?


texts: Where files are used if path entered by hand

texts:
I am brining a 100 or so static pages into my drupal install here. We are pasting the content from the static site into the body of a content type. I am using ICME to upload the images and documents. Unless I directly link from ICME to the document, I've noticed it does not record as being used (/admin/content/files > USED IN). Is there a batch script to run to check if a file is used somehow?

We are adding the files, but only updating the path via code editor find and replace... I do not want to hightlight each image and find the file in Drupal. The files are being recorded in the system as IMCE does that and if we do actually use the ckeditor IMCE link it does show as used. Just to emphasize that.


texts:
I'm using views 3 to show a page.

I added a header to this view ("global: text area"), in whom I added a field/link "add comment" with token.

My problem: when the current user is not connected, I have a message of type: Log in or register to post comments.

I would like to keep the text link "add comment", which sends back to the page of connection.

I tried to modify the view field template, but it does'nt work.

I try to use function THEME_node_view_alter (&$build) {unset($build['links']['comment']['#links']['comment_forbidden']);} in a custom module, but it does'nt work too.

I found that it came of theme_comment_post_forbidden, but I do not know how to modify it.

Do you know how can it be done?


texts: Including an external library functioning using namespace with xautoload

texts:
I'm trying to include the PHPInsight library for performing sentiment analysis on user data.

Based on the demo file provided in it, I added it into the sites/all/libraries path so that it would read sites/all/libraries/phpInsight and tried to create an object

$sentiment = new \PHPInsight\Sentiment();

which resulted in blank screen.

Following this I looked into

Include a third party library using namespaces, dependencies and
https://www.drupal.org/node/1976234.

Apparently owing to a known constraint of D7 with namespace installed the xautoload and modified the hook_libraries_info as below

function analyzer_libraries_info() {
 $libraries['phpInsight'] = array(
  'name' => 'PHP Insight',
  'vendor url' => 'https://github.com/JWHennessey/phpInsight',
  'download url' => 'https://github.com/JWHennessey/phpInsight/archive/master.zip',
  'files' => array(
    'php' => array('autoload.php'),
    ),
  'xautoload' => function($adapter) {
    $adapter->namespaceRoot('\PHPInsight', 'lib');
  },
  );
 return $libraries;
}

I'm still uncertain about how to use the xautoload and my autoload file that needs to be included is in sites/all/libraries/phpInsight/autoload.php. Since I haven't used libraries API or PHP namespaces and some clarity on what needs to be done to get it included and instantiate the object with how it happens would be of great help.


texts: Adding a new NOT NULL field to a table causes an error

texts:
When attempting to add a new column to a table within an update hook, the error Null value not allowed: 1138 Invalid use of NULL value occurred, the definition was changed to allow NULL, and the value for existing rows was set to NULL.

function MYMODULE_update_8101() {
  Drupal::database()->schema()->addField(
    'MYMODULE_table',
    'created',
    [
      'type' => 'int',
      'unsigned' => TRUE,
      'not null' => TRUE,
    ]
  );
}

When adding the column to the database with an SQL query, using the NOT NULL restriction causes the field to have a default value of 0, and no error happens.

How can the error be fixed, and the proper schema set?


texts: How can I load comment IDs using the comment type?

texts:
I know how to load comment ids for a particular node by following code

$entity_manager = \Drupal::entityTypeManager();
$cids = $entity_manager
    ->getStorage('comment')
    ->getQuery('AND')
    ->condition('entity_id', '25364')
    ->condition('entity_type', 'node')
    ->execute();

But I need one more condition to add on because this node might have multiple comment type linked. I know the machine name , but I don't know exactly what should be the first parameter to be passed in condition.


texts: Prevent spammers accessing my site by blocking their IP address

texts:
Story:

I have my drupal site hosted in aws. Initially there were so many spam registrations occured. I prevented this completely by google recaptcha. By checking the recent logs in drupal I see the registrations comes from 2 ip address repeatedly.

Steps I tried to block IP:

1) Added the code to htaccess:

order allow,deny
deny from ***.**.**.*
deny from ***.**.**.*
allow from all

When i give these 2 ip address in the htaccess, the site shows Forbidden(tried from other systems too). When I give some other ip i am able to access the site.

2) Drupal ip blocking configuration
When I give these 2 ip address , it says not a valid ip address. Every other ip address it accepts. Then I tried to add sample ip and changed the ip address from the db table 'blocked_ips', then when I load the site, it says it is blocked.

From the drupal log i could see that the hacker is trying to create spam contents. I need to block their IP address. They have prevented me to do so somehow, thats why the above steps do not work.

Something strange is going on. Any ideas to prevent this. All welcome.


texts: Passing dates or date ranges into a view as arguments

texts:
Drupal 7, Views and Date modules installed.

I have a view on a content type with a date field (timestamp, but I can change it if necessary)

When I use it in filter criteria, I have no problem to use criteria like Mydate greater than, less than, between, not between etc.
But if I try to do the same thing using contextual filters I have only the "equal" criteria. I need to do this, so i can call the view from code passing arguments to it.

I found some pages about Drupal 6 where is written that i can pass parameter to the filter in format: 2008-11-12--2010-11-12, but when i try to make it and hit 'update preview', i obtain: (field_data_field_test_date.field_test_date_value = '2008-01-01--2010-12-31') in the query.

I need to:

use criteria greater than, less than, between
pass date range to the view

Does anybody have some suggestion on how I can do it?


texts: How to disable context from URL in Views

texts:
I use D7.
I have a view which I want to show only current user. Those fields, in the view, are related to the current user via relationship of Profile. So, I can also say that the current user can view their own profile's fields.

So, I set 'User: Uid' as 'User ID from logged in user' on contextual filer. But, if I write non-current user's uid after page's path(Let's say '/test-user') like '/test-user/100', it outputs that user's(uid=100) fields.Even if I set 'global $user; return $user->uid;' with PHP Code for User: Uid instead, I got the same result.

For some reason,  with Field Permission module, I set those fields as 'View anyone's value for field_name'. So, I have to control the visibility in this view somehow.

Can anybody give me some advice?
Thank you.


texts:
I need the $user object within a module am creating. But am not able to get it. I have created a module that extends user object hold more data. Its working fine. I am also
able to use this values in theme files. But am not able to get it in any function within
a module.

The standard value $user->name; or my custom value $user->data['privacy']; nothing is available in module.

I tried using this

global $user;
$user = $user->name;

What is the mistake here? Is it that global is not the right way to get the user object?


texts: Webform response: "Illegal information. Data not submitted."

texts:
I have a very simple webform (ie. name, email, comments) that has begun giving this response to any submissions, no matter what they are:

Has anyone seen that before? The results are still saved in the webform but it causes confusion and people also enter their comments multiple times as a result.


texts: How to maintain a local mirror on my Mac?

texts:
I have a personal Drupal 6 site being hosted commercially, and I would like to maintain a mirror of the site on my local MacBook for the purposes of developing custom modules and themes before deploying them.  My question has two parts:

How do I set up my Mac so that it's ready to install Drupal?
How do I mirror my live site locally?


texts: Select order type and store with hook_form_alter()

texts:
In drupal commerce, I have 3 stores and 3 orders type
When placing a manual order, i am first asked to choose the store and the order type ( which are entities), with radio buttons.
With a select list, I know how to programmatically select one option, with the following code.

function reservation_form_commerce_order_add_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['type']['widget']['#default_value'][0] = 'type_order_1';
  $form['store_id']['widget']['#default_value'][0]['#value'] = 1;
}

How do I do the same with the button?


texts: Theme generic file link in node template

texts:
I want to change the text on a link to download a file in my node template. In Manage Display I have selected  Generic File as the formatter which outputs this

but I want to change it to this

How can I do this?


texts: How to group fields and place in seperate tabs/local tasks?

texts:
I want to group fields and create different tabs/local tasks for them with their own dedicated pages. How can I do that?

I found one module that looked promising, but also that one has bug on installation: https://www.drupal.org/project/entity_ui

What other options do I have?

I tried ask the question before but it was mistakenly marked as duplicated so open a new question to allow for answers:
How to group fields and place in seperate tabs?


texts:
how do I upload images (Media) to specific folders inside the default directory? I will have thousands of pictures and would like to have an organized structure of folders.

Thanks a lot.


texts: Webforms Ajax File Upload Issue with IE7 and IE8

texts:
The file upload fields in my webform work everywhere except IE7 and IE8. When I click the upload button I get a js alert that says the following

"An error has occurred while attempting to process /file/ajax/submitted/nameofmyuploadfield/form-reallylongrandomstring:"

I've tried several different versions of jQuery through the jQuery Update module but to no avail. I even tried the webform module right out of the box on a new drupal instance and got the same error. I'm having a hard time believing webform file uploads were never meant to work on IE7 and IE8 but that seems to be the reality of my situation. Please share some wisdom about overcoming this issue.

here is an example to the out-of-the-box webform file upload not working in IE7 and IE8
http://bonkmas.com/vids/node/4


texts: $language variable causes a lot of notices as non-object

texts:
I get a lot of notices on my site.

f.e.
Notice: Trying to get property of non-object in drupal_lookup_path() (line 77 of /home/srv/www/mysite/includes/path.inc).

Notice: Trying to get property of non-object in template_preprocess_html() (line 2497 of /home/srv/www/mysite/includes/theme.inc).

and many other.
And also warning:
Warning: Attempt to assign property of non-object in template_preprocess_html() (line 2497 of /home/srv/www/mysite/includes/theme.inc).

I don't know how to fix this. Thanks to all for help.


texts:
To load a Panel display from the database we can use panels_load_display($did)

However, the $did value is an autoincrement value from the database. It is not present in exported Panel page displays (e.g features export).

I thought perhaps we could use ctools_export_object_load to load the exported panels display.

However, I found that it only returns a result if the display is in the panels_display table in the database, and returns empty empty for exported code storage displays.

e.g:

// Attempt to load Panels display
ctools_include('export');
$uuid = '49c15c71-d5d1-d574-b539-0149f912f925';
$display  = ctools_export_load_object('panels_display', 'conditions', array('uuid' => $uuid ));
var_export($display); // empty array if not in DB.

How can we load a Panel display in code when that display is exported in features and using code-based storage?


texts: How can I create an entity bundle programmatically?

texts:
Given a custom defined entity 'Foo', how can I make a bundle programmatically?

Such as Node entity has the Article and Basic page bundles (with fields) on install.


texts: Can I override a theme function from a contributed module

texts:
Per this question, Can I modify guestbook.module safely? I have overridden theme_guestbook_entry() from the guestbook.module file.  The problem is that my modifications are not taking effect. (Yes, I rebuilt the cache.)

I am following these instruction here, http://drupal.org/node/11811. I notice they don't mention contributed modules at all. Am I able to override these?


texts: How to add active class to link which is loaded via views and links comes from content type

texts:
I have created a content type calls as "XYZ Inner Pages".
Here I am adding a Fieldset and inside field set I am adding field type as Link.
Now I create a page using XYZ "Inner Pages" Content Type, add content and the links.
I am hiding the Links from Manage display because I want to show those on the right side of page.
Now I am creating a view which will pull all the links from "XYZ Inner Pages" Content Type.
Now I am showing the views block in the right section of "XYZ Inner Pages" Content Type page.
This right block will list the link.
Now I want to add active class to links so when I open any of the link from that list, then opened link from the list should be highlighted.


texts: Why are there no pending db updates when i reset system.schema entry?

texts:
I am confused about a few things to do with db updates.

I have a messed up site caused by commerce and importing configuration. I want to re-run the commerce updates to ensure that they were done (as they most likely have not been).

I see a simple update function in commerce.install: commerce_update_8201.

when i do:

drush ev "echo drupal_get_installed_schema_version('commerce');"

i get 8201.
i then run:

drush ev "echo drupal_set_installed_schema_version('commerce', 1);"

and i can verify in the key_value table that this has been set to 1.

but now, when i run drush updb - it states: [success] No pending updates.

when i go to updates.php i get:

  Some of the pending updates cannot be applied because their    dependencies were not met.
  No pending updates.

Next I try to force the update by running:

drush ev "module_load_install('commerce'); echo commerce_update_8201();"

I added an "echo" in the update script so that i could tell the code was run (otherwise there is no output and hard to tell anything happened). The code does get run by that last drush command.

But the system.schema is not updated in the db.

Does all of this sound like expected outcome. There sounds like at least a few bugs in Drupal core here.


texts: Show file field as thumbnail if file is an image?

texts: I've added a field to comments to allow users to upload files. I want users to be able to upload different types of files, but if it's an image then show a thumbnail. Can this be done while just using 1 field?


texts: Get Entity from Path or Url Object Retrieved from Menu (Node or Page)

texts:
Linking through menu link tree elements I'm getting a series of url objects and paths. What I'd like to do is turn those url objects or paths into entities. I want access to the actual entities that they refer to. Here's my code so far:

$menu_tree = \Drupal::menuTree();
$menu_parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_id);
$menu_tree_elements = $menu_tree->load($menu_id, $menu_parameters);
foreach ($menu_tree_elements as $menu_tree_element) {
  $menu_tree_link = $menu_tree_element->link;
  $url_object = $menu_tree_link->getUrlObject();
  $path = $url_object->toString();
  $url_params = \Drupal\Core\Url::fromUserInput($path)->
    getRouteParameters();
  var_dump($url_params);
}

I was thinking that I could possibly get the entity from the url parameters but I get the error

  External URLs do not have internal route parameters.

Which makes sense to me because I have menu links that refer to just general Page entities not nodes. Like '/about'.

However I'm able to get to the paths just fine. Is there a way that I can load an entity since I have a url object that has a path directly leading to it?

UPDATE: I tried using

$params = \Drupal\Core\Url::fromUserInput('/about')->
  getRouteParameters();
var_dump($params);

But all that did was return an empty array.

I received the same result when using

$params = \Drupal\Core\Url::fromUri("internal:/about")->
  getRouteParameters();


texts:
I use RULES module to create a node (my custom content type) on user creation - so another words every user gets ONE, UNIQUE node when creating account.

Now I would like to have a navigation menu for users, where each user has a link to his own node. How can I achieve this?

EDIT:

Just as example, imagine we are talking about node as user profile. Each user gets one of those nodes on user creation and I want to have a navigation link to edit/view this node.


texts: How to change text on Drupal WorldPay button?

texts:
I'm using the Drupal WorldPay module (for Commerce 7.x-1.11).

On the checkout page it says "Pay via WorldPay". I want to change this. I've traced it back to a line in the module:

function commerce_worldpay_bg_commerce_payment_method_info() {
  $payment_methods = array();

  $payment_methods['commerce_worldpay_bg'] = array(
     'title' => t('Payment via Worldpay'),
     'description' => t('Integration with Worldpay\'s Business Gateway method.'),
     'active' => TRUE,
     'offsite' => TRUE,
     'offsite_autoredirect' => TRUE,
     'callbacks' => array(),
   );

  return $payment_methods;
}

Specifically:

'title' => t('Payment via Worldpay'),

I think I can override this in the theme template.php but have no idea how, and there seems to be very few instructions on how one might go about it.


texts:
I'm using Drupal Commerce with the Recurring module for subscriptions. Now when I create initial order with multiple recurring cart items for each recurring item separate recurring order is created. This means that each recurring order will have shipping costs and for each recurring order customer will receive "order shipped" email.
Is there a way to configure recurring module not to create separate recurring order for each recurring cart item, since ... they are all ordered together and most likely they will be shipped together - they have same subscription models (same periods).
Here: https://docs.drupalcommerce.org/commerce2/developer-guide/recurring/create-subscriptions
it says: " If the order is valid, we iterate through the order's items. If an order item's purchasable entity has both a "subscription type" and "billing schedule", then a new subscription is created for the item."


texts:
I am working with Drupal 7, and I have a block generated by the Views module with titles of many articles. When the user chooses a title, I want a popup with title, body, and image to appear.

Is it possible with any module?


texts: How do I get the form submitted data in a custom module?

texts:
I have create a webform in Drupal 7. I want to access the submitted data in a custom module.

I used my_module_form_submit($form, &$form_state) but no data has been found.
Please Help.


texts:
I have two content types
BLOG and PROPERTIES

In BLOG, I have an entity reference field called "Related properties" that will point to the PROPERTIES content type.

Every BLOG node is gonna have a unique set of entity reference values i.e Content/Contents of PROPERTIES content type.

Now what I want is to list the entity referenced contents of content type PROPERTIES in a view with respect to the nid of the content of type BLOG.

How can I do this using Views?


texts:
Currently I am able to run the Unit test from the below command

C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\bin>phpunit -c
 ../../core/phpunit.xml.dist ../../modules/custom/lse_demo/tests/src/Unit

PHPUnit 6.5.0 by Sebastian Bergmann and contributors.
......                                                              6 / 6
(100%)
Time: 10.62 seconds, Memory: 6.00MB
OK (6 tests, 12 assertions)

But When I tried to do the same with Kernel test I get below error

C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\bin>phpunit -c ../../core/phpunit.xml.dist ../../modules/custom/lse_demo/tests/src/Kernel
PHPUnit 6.5.0 by Sebastian Bergmann and contributors.

EEEEEE                                                              6 / 6 (100%)

Time: 11.43 seconds, Memory: 6.00MB

There were 6 errors:

1) Drupal\Tests\lse_demo\Kernel\DefaultControllerKernelTest::testDefaultController with data set #0 ('work', 'User', 'Welcome User to Work')
PHPUnit\Framework\Exception: PHP Fatal error:  Uncaught PHPUnit\Framework\Exception: Could not read "../../core/phpunit.xml.dist".

  thrown in C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\phpunit\phpunit\src\Util\Configuration.php on line 189

Fatal error: Uncaught PHPUnit\Framework\Exception: Could not read "../../core/phpunit.xml.dist".

  thrown in C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\phpunit\phpunit\src\Util\Configuration.php on line 189

PHPUnit\Framework\Exception: Could not read "../../core/phpunit.xml.dist". in C:\Acquia_dev_desktop\LocalInstance\drupal_new_lab\vendor\phpunit\phpunit\src\Util\Configuration.php on line 189


texts: How to use Ubercart product SKU as a condition in Rules?

texts:
I need to display a message on the cart page if one or more specific SKUs are added to the cart.

For example, if a product with SKU # ABC123 is added to the cart, the Rule should be triggered and thus display a message... if a product with SKU # XYZ789 is added to the cart, the Rule would not be triggered and no message would be displayed.

It seems like this should be a fairly simple function, but for the life of me I cannot find a way to accomplish this. Can anyone please point me in the right direction?

Thanks!


texts: How to create unique banner for each node and views page?

texts:
What I am trying to achieve:

I want the unique banner image for each node and the views page, where the site administrator can simply upload the image and description to upload the banner for each node.

What I have done so far:

I have created the custom paragraph (https://www.drupal.org/project/paragraphs type) with image and description field and attached it to the content type.

Then I have hidden the paragraph field from manage display and then I installed field as block module(https://www.drupal.org/project/fieldblock) to display my attached field, particularly attached with the node from block layout in the custom banner region.

Problem:
With this approach I successfully created a unique banner for content type; however, I am not sure how to achieve this in views page. Any other approach I could achieve this?


texts: cannot deselect module from list even when deleted from database

texts:
Still trying to remove 3rd party module from drupal list of modules and have followed disabling modules manually tutorial here https://drupal.org/node/157632

It shows empty set from both modules I disabled and followed the cache instructions for mysql but the modules remain stuck in the list and ENABLED with no way of removing them.

Do I need to delete the module list somehow and have it rebuild itself or something?


texts: Dont Refresh Drupal's Page after a button is click in Forms API

texts:
I had started developing a module in Drupal. I made two form controls: a fieldset and a button. The button calls a javascript function "myphoto_options" when it is click. This function only does an alert function. After executing the called function, the page then immediately refreshes the page. How to prevent the page from reloading?

Below are my codes:

function myid_user_page_form(){
    $form = array();
    $form['id'] = array(
        '#type' => 'fieldset',
        '#title' => t('ID Information'),
        '#collapsible' => TRUE,
        '#collapsed' => FALSE,
    );
    $form['id']['myphoto_button'] = array(
        '#type' => 'button',
        '#value' => '...',
        '#attributes' => array(
        'onclick' => "myphoto_options();",),
    );
    return $form;
}

Javascript function:

function myphoto_options(){
    alert("Hey");
    return false;
}

Any help would be very much appreciated. Thanks.


texts: How can I trigger custom code when some other module is being installed/uninstalled?

texts:
I am using a third-party module. Whenever it is installed or un-installed, I want to programmatically create/delete some menus.

How can I detect that a module is installed or un-installed?


texts:
I'm looking for a simple way to search thru the plaintext/source of hundreds of nodes. I need to find-replace all the color settings for a certain font awesome icon (fa-check), but can't find any good way to check our source for which pages are using that icon. New Drupal admin here, haven't really done any dev work, so answer that doesn't require installing new modules would be great.

We're using Solr for search, incidentally.


texts: Randomize url alias where every time a user logs in the url is different

texts: I would like to generate a random url for a certain page every time when a user logs in to see this page. The idea is that copying the url to somebody else does not work. How would I do that?


texts: Applied Image Styles Cause Failed Image Render

texts:
I'm using Aquia Dev on Windows 10 for a local installation and after the latest Drupal 8 update (8.2 to 8.3), applying image styles to content now causes my images to fail to render.

Checking debug and the directory, the paths site/MY-SITE/files/styles/MY-STYLES are correct and the images are there, but for whatever reason Drupal can't pull the images. The alt text is displayed instead. Image-styles that were applied to items before the update still render correctly, but changing the styles on the correctly rendering images thereafter again breaks them.

Most of the information I have found is geared toward changing "775" ownership on a Unix platform. I can't figure out what that means and translate it to a Windows set up.


texts: How to sort table with columns not from database

texts: I have table with both fields from database and field that is calculated using values from database. Now I can only sort table by using columns form database. Can I do it also on this other field?


texts: Templating. Check if entity is comment or node?

texts:
I'm modifying a template file for an Advanced Forum sub theme. AF uses a single template to theme both nodes AND comments with the same markup. I need to add a php check inside the node template to see if the current entity is a node or a comment, then print some flags based on the result.

I don't think there is a straight forward $entity_type variable to check, so how would I go about writing this?


texts: Content type not responding to AJAX callback

texts:
I am using a ctools content type plugins to render a custom form that will have only one submit button.
The submitbutton will switch an eck entity field (boolean) from 0 to 1 and back (if pressed again, of course).
I have defined my ctools content type plugin, form (with ajax callback) and a submit handler
When i tested it with a hook_menu path, all was fine and it worked.
Since i have put it in a ctools content type, no luck.
Any help would be very much appreciated!
Ps: What would be the best place to put my database logic? The submit handler?
Thanks a million!
$plugin = array(
  'single' => TRUE,
  'title' => t('Project isClient'),
  'description' => t('Project isClient AJAX plugin'),
  'category' => t('Project'),
  'render callback' => 'project_isclient_ajax',
  'defaults' => array(),
);

function project_isclient_ajax() {
  $pane = new stdClass();
  $pane->title = t('Project isClient');
  $pane->content = drupal_get_form('project_isclient_form');
  return $pane;
}

function project_isclient_form($form, &$form_state) {
  return array(
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('Subscribe'),
      '#ajax' => array(
        'callback' => 'project_isclient_ajax_submit',
        'wrapper' => 'project-isclient-form',
        'method' => 'replace',
        'effect' => 'fade',
      ),
    ),
  );
}

/**
 * Ajax callback function.
 */
function project_isclient_ajax_submit($form, $form_state) {
  // Dummy/dumb validation for demo purpose.
  return 'works!';
}

A little after posting this, i found AJAX calls in CTools Content Type Plugin? which states that ctools handles ajax forms differently. I checked using blocks, and this appears to be correct.
In a block my callback works.


texts: How to resolve "Not Found" + "403 Forbidden" errors on "Request New Password" link

texts:
When I click on the "Request New Password" button, I get the following message:

Not Found

The requested URL /user/password was not found on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Apache Server at berniesdogtraining.com Port 80


texts: Is it possible to to export the menu structure of my drupal site using the services module? This way the website structure can be generated on the drupal website -> make it available for webservices -> acces by mobile in order to build the same structure dynamically in the mobile app.


texts:
This is the code in my template.php file.

function studiga_theme_theme($existing, $type, $theme, $path) {
    $items['add_property_form'] = array(
        'render element' => 'form',
        'template' => 'node--14',
        'path' => drupal_get_path('theme', 'studiga_theme') . '/templates/node',
    );

    return $items;
}

 function custom_add_property_form($form, &$form_state) {
    $form['first_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('First name')),
    );
    $form['last_name'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Last name')),
    );
    $form['address'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Address')),
    );
    $form['city'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('City')),
    );
    $form['state'] = array(
        '#type' => 'select',
        '#options' => array(
            'default' => 'State',
            '...' => '...',
        ),
    );
    $form['zip'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Zip')),
    );
    $form['email'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Email')),
    );
    $form['phone'] = array(
        '#type' => 'textfield',
        '#attributes' => array('placeholder' => t('Phone')),
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit',
    );

    return $form;
}

This is the code in node--14.tpl.php.

                Contact Information

        <?php print render($form['submit']); ?>

But no fields are appearing - what am I doing wrong? You can't have a straight forward  in a tpl.php file can you?


texts: I think Im getting some spammers adding user accounts to my site. I've been checking the users section of my site daily and I'll see these strange email addresses. So I check on the reports and find that they are spammers. Has anyone encountered this problem? Im currently researching it to try and stop it.


texts:
I am writing a module that executes some queries, and returns the result in to a collapsed fieldset which is not shown as collapsed; I view its content. The collapse.js files are loaded.

This is the code I am using.

$body = $body . '<fieldset class="collapsible collapsed">' .
  '<legend class="gestioneinterna">Viste aggiuntive</legend>' .
  '<description class="description">fieldset extra.</description>' .
  '

Vista progetti

';
print $body;


texts: How to know where the value of a field is being stored in

texts:
I have a field_date in a content type.

I want to do something like this on a tpl.php:

$date->____________ (where the value of the field is being stored)

How can I know this?


texts:
With profile2 all the profile page titles is the profile type.

How do I override it with a field from profile2?

I was wondering something like this

hook_preprocess_page(&$variables){
if ($page-type == profile2) {
$new_title = field_get_items('profile2', $profile, 'field_new_title');

  drupal_set_title($new_title);
}
}

Of course this script does not work.

This needs to happen just on the profile page, not in the profile listing page.


texts:
I'm trying to adapt the next code from the book:
http://www.amazon.es/Drupal-Development-Experts-Voice-Source/dp/1430228385/ref=sr_1_1?ie=UTF8&qid=1327316185&sr=8-1

function _job_post_installed_fields() {
  $t = get_t();
  return array(
    'job_post_company' => array(
      'field_name'  => 'job_post_company',
      'label'       => $t('Company posting the job listing'),
      'type'        => 'text',
), );
}
/**
 * Return a structured array defining the field instances associated with this content type.
*/
function _job_post_installed_instances() {
  $t = get_t();
  return array(
    'job_post_company' => array(
      'field_name'  => 'job_post_company',
'type'
'label'
'widget'
'type' ),
  => 'text',
  => $t('Company posting the job listing'),
  => array(
=> 'text_textfield',
      'display' => array(
        'example_node_list' => array(
          'label'       => $t('Company posting the job listing'),
          'type' => 'text',
        ),
), ),
); }

But I can find anywhere a list of types I kind use instead of "text".

My question is:
Can you help me find a place where I can find a list of possible images?
How that code would be if I wanted to create an image field, or a tag list field?

Thanks


texts: Insert value into field before and after specific string

texts:
I need help with update function.

I have database table with three fields. One of them is code field with html div and script.
Example:

My problem is, how am i supposed to insert some condition inside script tags and to end it before closing script tag? How should i write db_update to accomplish that?

Thanks in advance.


texts: Need to convert datetime to date during D8 migration from non-drupal source

texts:
I'm working on a migration where I have

2012-05-07 00:00:00.000000

in my timedate field, but I need to convert it to:

2012-05-07

I realize that I should put this in the prepareRow function, but I'm not sure what it should look like.


texts: How do I get translated paragraph values?

texts:
{% for item in contents.hotel_attractions.field_banner_image_slider %}
    <h1>{{item.entity.field_main_caption.value}}</h1>
{% endfor %}

field_banner_image_slider is a paragraph entity. field_main_caption is a field of the paragraph.

I have used $node->getTranslation($language) to get the translated node. In twig with the above code it prints the default language value without translation. In the same node the contents which are not from a paragraph entity prints the translated value correctly.

I have enabled the translations for paragraph fields from configurations.


texts: How to unpublish a node with vocabulary term X after Y hours?

texts:
How could I automatically unpublish a node after Y hours (e.g. after 24h after it appears on-line) but only when it has a specific category - category is based of course on taxonomy's vocabulary.

Important is that an editor has no influence on number of hours after which the node is unpublished - so it must be predefined by the admin.


texts:
I am responsible of making a county based community newspaper so that means I will have something like *.domain.com eg. a.domain.com, b.domain.com, etc.

Now I don't want content from a.domain.com to be visible through b.domain.com enters domain access which made my life so blissful and achieved this relatively easily. Now I am trying to achieve the same using Nodestream. I have been at it for months and would really need some help on this. Any ideas?


texts: How to upload multiple images in a single browse option in webform file component field?

texts:
I have added file field in webform content and tried to browse multiple images and upload it @once, But webform file field only supports only one image while clicking single browse. Tried Installing Webform Multiple File Upload still its only supporting one image per browse.

Is there any way to upload multiple images in a single browse option and upload it.Thanks in advance.


texts:
I try to develop a D8 module with entities. A lot of them ^^. But there is an issue with the way D8 handles the creation of tables during the installation process. If the definition of the entities is not correct D8 can't create the table. But the module is enabled anyway.

Now D8 is not able to uninstall the module. I have tried drush pm-uninstall, drush cr, drush dre on the module. The uninstall process fails every time because D8 cant find the table and is obviously not aware of the failed installation of the module.

The only way I figured out was to create the tables with the primary key and then to uninstall the module. That works, but is very time consuming. How can I force uninstall my module even if the corresponding tables doesn't exist? And why is D8 ignoring the fact that the module was not installed correctly in the first place?


texts: How do I add a css class to body from a page callback function?

texts:
I have a module that produces a lot of pages. A set of these are handled by a particular part of my application, and I would like all these to have a class added to either html or body. I'd settle for #block-system-main.

The existing answers point to a template preprocess hooks e.g. hook_preprocess_html() but this feels wrong.

I'd have to create that hook and then tell it to go somewhere else to determine which page call back was used and which class to apply - it's all backwards. Drupal's already selected the right callback, so a 2nd lookup is another thing to maintain and an inefficiency.

I could of course do something like set a global $extra_page_classes variable and then implement the hook to add these classes to the page, which is more efficient but it's still messy. Or I could add (yet another) wrapping <div> to my callback output, but that's not going to give a themer chance to adapt the rest of the page elements outside of the main content.

Seems odd that a page callback, responsible for the substantial content of the page, can't set page-level attributes. A page callback can, for example, choose to call drupal_add_css(), but it (apparently) can't do something as simple as add a class to the page.

As it seems odd and Drupal usually has some (often hidden) elegance, I thought I'd ask specifically if there was a better way.


texts: How to add Email field in Checkout page and sending E-mail in Drupal Commerce?

texts:
I did cart using "commerce_kickstart-7.x-2.4-core" module. I would like to add "Email Id" field when doing a checkout. Actually I need that If user provides different email Id's rather than registered mail-id in "BILLING INFORMATION" and "SHIPPING INFORMATION" then after completion of Checkout process, the product payment details should send mail to those E-mail Id's.

Rules export

{ "rules_check_order_for_billing_information_mail" : {
    "LABEL" : "Check order for Billing information Mail",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "commerce_checkout" ],
    "ON" : [ "commerce_checkout_complete" ],
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "commerce_customer_profile",
            "param_type" : "billing",
            "param_user" : [ "site:current-user" ]
          },
          "PROVIDE" : { "entity_created" : { "entity_created" : "Created entity" } }
        }
      },
      { "mail" : {
          "to" : [ "entity-created:field-billing-email" ],
          "subject" : "Test Subject for Billing mail",
          "message" : "Test Message for Billing mail",
          "language" : [ "" ]
        }
      }
    ]
  }
}


texts:
I have a website in 2 languages. The site uses panels. The nodes Comments form & comments only shows in English and not in Greek.

Has anyone encountered a similar problem? Thnx in advance.


texts:
Currently our json responses are not formatted at all, we are using the JsonResponse class to return a status code with content:

  public function getMarkets() {
    $response = $this->marketService->getMarkets();

    return new JsonResponse($response, 200);
  }

Is there an easy way to make sure all json responses are formatted as camel case or do we have to make sure the properties are camelcased before passing them to the JsonResponse object?


texts: How to add a tooltip to a Form API field?

texts:
I have a field defined like that:

'name' => array(
  '#title' => t('Name'),
  '#type' => 'textfield',
  '#size' => 30,
  '#maxlength' => 45,
  '#default_value' => $item->Name,
  '#description' => t("Item's name, no longer than 45 characters."),
),

How can I turn the description into a tooltip that will appear when user keeps mouse cursor over form element?


texts: How to let users log in using Drupal default login when they used a custom join module?

texts:
We have two ways to join and log in the site:

1 - Via the university authentication module (it is a third party authentication module that I cannot update). It requires a username (not an email address) and a password.

2 - Register with email address, receive one-time login link, set password (Drupal default module).

How can I have the first type of users (who used the university authentication module to join) also login with an email address and password without using the university authentication module?

I am using Drupal 7.

Thank you!


texts: delete URLs of all terms for a specific taxonomy vocabulary

texts:
Using pathauto module,  I know we have a Delete aliases tab to delete URLs in bulk but what if we need to delete URLs of all terms for specific vocabulary?

Any idea how to do that?


texts: Searching by sku number but some products and new product are not showing using search api drupal 7

texts: Some products are showing by sku number but some products are not showing.please someone help me to solve this problem.


texts: I am using drupal 7 . I am having issue with drupal admin menu. When I open new menu this time admin menu disappear and after refresh this page 2-3 times then menu display.


texts: Why can't I update my Drupal modules and themes?

texts:
Suddenly I found my self in a big issue: I just can't upadate my Drupal modules and themes.

When I run the update script via the GUI, the download phase passes correctley (or it seems to be). But when I perform the database update and I click to "Continue" and putting the site under maintennace mode, nothing happens. And also a major problem come: the maintenance mode persist even when I disable it.

To resolve that issue I clear all the cache from the database.

Any idea or help for that?


texts: Notification when a shopping cart is abandoned

texts:
How to create a notification when a shopping cart is dropped ?

I wish that the user who has not completed his / her order, receives an email 1 day after, to tell him that he has a basket in progress.

I think this should be possible with the "Rules" module.

Thank you


texts: 500 internal server error on a single node

texts:
This just happend randomly today. I tried to access a page, but it keeps giving me a 500 internal server error http://www.austravel.com/holiday-destinations/australia

All the other pages are working fine. Any ideas why this may be?


texts:
i'm reviewing the source code of a module, the following is the code

/**
 * Implementation of hook_userpoints api().
 */
function uc_userpoints_discount_userpoints($op, $points = 0, $uid = 0, $event = '') {
  $userpoints_translation = userpoints_translation();
  switch($op) {
    case 'setting':
      if (module_exists('uc_cart') && module_exists('uc_payment')) {
        $group = 'uc_userpoints_discount';
        $form[$group] = array(
          '#type' => 'fieldset',
          '#collapsible' => TRUE,
          '#collapsed' => TRUE,
          '#title' => t('Ubercart Discount Options'),
        );
        $form[$group][USERPOINTS_UC_DISC] = array(
          '#type' => 'textfield',
          '#title' => t('!Points used in discount (for every @currency)', array('!Points' => $userpoints_translation['!Points'], '@currency' => variable_get('uc_currency_code', 'USD'))),
          '#default_value' => variable_get(USERPOINTS_UC_DISC, 1),
          '#size' => 5,
          '#maxlength' => 5,
        );
        $form[$group][UC_USERPOINTS_DISCOUNT_MAXP] = array(
          '#type' => 'textfield',
          '#title' => t('Enter the maximum percentage of the order total that can be discounted using points. Please do not include a % sign'),
          '#default_value' => variable_get(UC_USERPOINTS_DISCOUNT_MAXP, 100),
          '#size' => 5,
          '#maxlength' => 5,
        );
        $form[$group][USERPOINTS_DISCOUNT] = array(
          '#type' => 'radios',
          '#title' => t('Enable !points as a discount method', userpoints_translation()),
          '#default_value' =>  variable_get(USERPOINTS_DISCOUNT,1),
          '#options' => array(t('No'), t('Yes')),
        );
    $form[$group][USERPOINTS_DISCOUNT_CATEGORY] = array(
          '#type' => 'select',
          '#title' => t('Discount Category'),
          '#description' => t('Category to assign awarded !points.', userpoints_translation()),
          '#default_value' => variable_get(USERPOINTS_DISCOUNT_CATEGORY, NULL),
          '#options' => userpoints_get_categories(),
        );
        $form[$group][UC_USERPOINTS_DISCOUNT_MODERATE] = array(
          '#type' => 'radios',
          '#title' => t('Moderate userpoints transaction'),
          '#default_value' => variable_get(UC_USERPOINTS_DISCOUNT_MODERATE, 0),
          '#options' => array(t('No'), t('Yes')),
        );
        $form[$group][UC_USERPOINTS_DISCOUNT_CLASSES] = array(
          '#type' => 'checkboxes',
          '#title' => t('Product classes discounts can be applied to'),
          '#description' => t('Leave blank for all.'),
          '#default_value' => variable_get(UC_USERPOINTS_DISCOUNT_CLASSES, array()),
          '#options' => uc_product_type_names(),
        );
      }
      return $form;
    break;
  }
}

i try to update the value of USERPOINTS_UC_DISC, it's not work, but other field is work fine, anyone knows what is the problem?


texts: Creating a table for identical fields of two or more Webforms

texts:
Drupal 7
Webform 7.x-4.0-alpha6

I have two webforms with two fields in common; "name" and "e-mail".

I want to display "name" and "e-mail" from all webform submissions in one overview table.

The webform submission data fields available to views use static references to the component id of an individual webform field. Thus, if the component id of webform fields were matching across webforms, I could use a view. But this is not the case.

So one strategy, as far as I can see, is to use the database abstraction API of Drupal 7.

I select the submitted_data table.

    //select table
    $query = db_select('webform_submitted_data', 'd');

Now I join with the component table. This will allow me to reference the form_key instead of the component id. I tie the tables together by the component id.

    //combine tables
    $query->join('webform_component', 'c', 'd.cid = c.cid');

Now I select the fields of my query. I want both the "name" and "email" field.
If I only want, say, the "name" field, this will work, I think:

    //select fields
    $query
     ->fields('d', array('data'))
     ->condition('form_key', 'name', '=');

However, since both "name" and "email" values are part of the data column, I cannot include both in the table, since when I build the rows of my table, I can only reference the field by the "data" column.

    //select fields
    $query
    ->fields('d', array('data'))
    ->condition('form_key', 'name', '=')
    ->fields('d', array('data'))
    ->condition('form_key', 'email', '=');

    $results = $query->execute();

    $rows = array();
    foreach ($results as $submission) {
     $rows[] = array(
      $submission->data,
      $submission->data, //how to distinguish between name and email?
     );
    }

Has anyone got an idea or tips on how to solve this? Specifically, how can I display two or more values from the data column of the webform_submitted_data table across multiple webforms in one table?


texts: Overriding Pathologic when it comes to img src

texts: I have Pathologic installed and it is working great from normal links in a document, but for anything that points to the file system ( img src for example) I can't get it to not use ?q= in the url.


texts: Custom Storage Fields (Not showing in my index)

texts:
namespace Drupal\custom_storage_example\Entity;

use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;

/**
* Defines the Dummy Entity entity.
*
* @ingroup custom_storage_example
*
*
* @ContentEntityType(
*   id = "dummy_entity",
*   label = @Translation("Dummy Entity"),
*   base_table = "dummy_entity",
*   entity_keys = {
*     "id" = "id",
*   },
* )
*
*/
class Dummy extends ContentEntityBase {

/**
* Provides base field definitions for the Dummy Entity type.
*/
public static function baseFieldDefinitions(EntityTypeInterface  $entity_type)
{
$fields['id'] = BaseFieldDefinition::create('integer')
  ->setLabel(t('Dummy ID'))
  ->setDescription(t('The Dummy Drupal Identifier'))
  ->setReadOnly(TRUE)
  ->setSetting('unsigned',TRUE);

$fields['custom_storage_field'] = BaseFieldDefinition::create('integer')
  ->setLabel(t('Custom storage field'))
  ->setCustomStorage(TRUE)
  ->setCardinality(1);

return $fields;
}

}

The "problem" here is, should this field (custom_storage_field) appear in the fields to be indexed? Pardon, in advanced if it is a newbie question. :)


texts: How can I display multiple taxonomy terms on a node?

texts:
I have a Drupal6/Ubercart setup. My products are categorised with taxonomy but we have a requirement that products can be placed into multiple category hierachies. For example, one product might be in:

Homeware
   Kitchens

and

Kitchens
   X Kitchen Range

The other requirement is that when displaying the product, the heading should show the breadcrumb of the hierachy as well as the category
name. This would be dependent on how the user got to view the product. If they went through the menu Homeware > Kitchens, this would be the breadcrumbs/heading displayed and vice versa.

How could I achieve this?


texts: How to override markup in my .theme file?

texts:
Below is markup from SearchController.php file. I want to change the "Search results" from my search page and also markup.

File : \core\modules\search\src\Controller\SearchController.php

if (count($results)) {
  $build['search_results_title'] = array(
    '#markup' => '<h2>' . $this->t('Search results') . '</h2>',
  );
}


texts: One view to do everything or a different view per page?

texts: If I need to display the last 10 nodes created on my front page regardless of content type and need to do the same in my sub-pages but need to filter by specific content type, is it easier to create several different views or to create one view that does all of that? If I need to create one view, how would I restrict different pages to specific content types?


texts: Views 3.8: Show taxonomy hierarchy in three columns (grandparent, parent, child)

texts:
I have a taxonomy with a three-level hierarchy, and would like to display the three levels in a views table, but separately. I'd also like to have an exposed filter using that taxonomy and let my users pick the term.

Here's what I've done:

Added the contextual filter Has taxonomy term id depth modifier
Added the relationship Content: Taxonomy terms on node with an identifier "term"
Added the relationship Taxonomy term: Parent term with an identifier "Parent" and set its relationship as "term"
Added the contextual filter Taxonomy term: Parent term and selected the "Parent" relationship
Added the taxonomy term field

At this point I can display the hierarchy in a single column and can choose between the lowest level child or all three (e.g. Grandparent > Parent > Child). However, I want to be able to display the grandparent, parent and child in separate columns.

Is this possible? I was hoping to maybe add the field three times and pick the hierarchy level, but I don't see how to do that.


texts: In the Aggregator module, limit number of items per feed

texts: I am using the Aggregator module in Drupal 8 to combine several RSS feeds, but I would like to set a limit on the number of items that are shown from any one feed. How can I accomplish this?


texts: Reading textarea values per row: what is the internal method?

texts:
If I'd like to create a textarea field for a admin configuration form that would include different configurations on multiple rows then how can I read these values/rows?

I know there must be a internal method for this since it is very common form field/input type. I just wouldn't like to invent it again.

And I just ran into a module that was using this same principal but it matched the rows with regex \n\r which turned into few gray hairs if you had only one value since it didn't then match if you didn't deliberately press enter. And for clarity it obviously didn't check that if the first line included text, just that regex and therefore no settings were saved.

That was also a wake up for that there must be some more intelligent and elegant way...


texts:
I am trying to change the links of the Language Switcher module. I am using the following code, but it doesn't work.

function mytheme_links__language_block(&$variables) {
  // Change variables
  return $variables;
}

When it gets executed, I get the following error:

  Notice: Array to string conversion in Drupal\Core\Render\Markup::create() (line 38 of core/lib/Drupal/Component/Render/MarkupTrait.php).

What is wrong? How could I return altered variables?


texts:
Not quite sure how to explain this, but I will go through what I did, and when the errors started happening.

I have enabled the default taxonomy view in Views, changed it to fields, and added a grouped filter.

After saving, I see the error "Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 .../html/includes/bootstrap.inc)." AND suddenly the admin menu has loads of new items in it?

I read up on it, but cant see any fixes, so try disabling and re-enabling the taxonomy view, and also admin menu.

Now the error message has gone, everything works fine, but I am left with all of these extra menu items in the admin menu.

I have logged in as other lower level users, and their admin menus are fine, yet as the super user (with all permissions) I have about 20 or 30 menu items added to the menu before the usual entries.

I have no idea where to start looking with this. The error above seems to happen when a module passes an array through check_plain(), so it usually a module error rather than core. But in this case, it seems to be the taxonomy view that has triggered it, unless its a coincidence.

Can anyone offer guidance?

EDIT: Also tried flushing cache. And worst comes to worse can revert to a backup 5 days ago, but will lose a fair bit of content, so want to avoid this.

EDIT: Looking phpmyadmin, I can see that all of these new menu items have indeed been added to the menu_links table, but do not appear in the structure > menus > management list.


texts: Boost not updating without www site after clearing cache

texts: Boost is working good on my website but the problem is that after making any changes to my website I clear all cache from performance page. The changes I have done are reflecting if I am accessing site with www but not updating if I am accessing website without www


texts:
I have a themed node view page (having an alias URL) where I have also themed the comments forms and comment threads.

A code snippet for that :

$form_template = drupal_get_form("comment_node_image_gallery_form", (object) array('nid' => $variables['nid']));
print drupal_render($form_template);

It all works fine but with one problem, when I try to post an empty comment thread, it takes me to the default comment-reply page and not in the alias page (http://mysite.com/comment/reply/138). Why is this happening and what is the way to stop this so that it gets redirected to the original aliased page when it gets stopped in the validation procedure?

FYI : However, when I submit a valid comment it takes me to the aliased page after successful submission.

Hope I made myself clear and thanks in advance...


texts: How to create dynamic panel column content?

texts:
Hello i am  new to drupal and trying to make a dynamic column content using panels,
so i had created a two columns the right side one is a menu and left side one is about to be dynamic, so when we click a link in the right side menu the content will be rendered in the left side one and we keep the right side menu visible.


texts: I have a bespoke content type with a lot of nodes, but alias urls have not been assigned to them. I need to bulk assign them consistent alias. I know on Drupal 7 this is possible to do using pathauto, however I have installed that for Drupal 8 and the batch assignment doesn't seem to be working yet. Is there another efficient way this can be done?


texts: Big cache_form slows Drupal website and the whole server

texts:
I have a custom form in my site. After couple of months a big issue appears.

Not only that the table cache_form has become huge, but also if I empty that table and disable my custom form, the cache_form keeps increasing over and over, so my website and whole server becomes very slow.

Some spambots are killing my server and I've already tried "Bad behavior" module, but there aren't any positive results.
Also my custom form has a Honeypot protection, so I receive very few spams from there, but the bots keep slowing everything.

Can anyone post some advice, anything will be useful?


texts:
The following is part of the comment.module file (line 950):

// Add indentation div or close open divs as needed.
if ($is_threaded) {
  $prefix .= $comment->divs <= 0 ? str_repeat('
', abs($comment->divs)) : "\n"     . '
';
}

Can someone explain that what is it doing?


texts:
I would like to know if it's possible to put an fixed image into a dynamic View in Drupal 6, it'll be something like that:

[exposed filter]

[fixed image]

[view field 1]

[view field 2...]

Thanks.


texts: Flexslider control not working in a show/hide div

texts:
I have my slideshow in a show/hide div and just couldn't get the manual controls to work when the hidden div is showed. If I move to another chrome tab and come back to the tab where the flexslider is (div is showing), the controls and the slider work just fine. I'll probably have to re-initialise flexslider but couldn't figure out where exactly in Drupal.

In my theme's script.js I could hide my flexslider with this bit of js:

$( '#flexslider-1' ).flexslider({
animation: "slide",
controlNav: true,

start: function( slider ){

$( '#flexslider-1' ).css( 'display', 'none' );

}
});

So, I know I can target my flexslider. But how do I go about re-initializing it? Am I thinking right or the problem lies somewhere else? Thanks.


texts:
I am in the processes of developing a module. I am trying to incorporate SimpleTest module in order to have a separate place that contains my code tests.

However, when I try to run a query against the tables in the database, which are build by me, I get:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'playground.simpletest311135TABLENAME
It tries to find a table simpletest311135TABLENAME while it should look for TABLENAME.
It always adds simpletest and some random number.

When I run queries against drupal default tables, like users and sessions, everything works perfect.
Any workaround?

Giannis


texts: Is there any harm is manually modifying file_managed status?

texts:
I'd like to manually change the status column of a record in file_managed.  The file URI is located in a permanent location. I simply forgot to change the status to 0 before performing file_save.  I have no need to for all the hooks to get called associated with saving a file.  So is it safe to manually update the status field in a file_managed record?

Along the same line, if there are no references to a particular fid in file_managed (ie no corresponding records in file_usage and no other fid references), is it safe to remove the file_managed record altogether?


texts: Problem with function from theme-settings.php in sub-theme

texts:
I want to create the sub-theme of my custom theme but I have the problem with the function from theme-settings.php.

I have a few managed_file fields in my theme settings and my submit function for one of them looks like:

function my_theme_settings_form_submit_home_back(&$form, $form_state)
{
    $previous = file_load($form_state['home_back_before']);
    $image_fid = $form_state['values']['home_back'];
    $image = file_load($image_fid);
    if (is_object($image)) {
        // Check to make sure that the file is set to be permanent.
        if ($image->status == 0) {
            // Update the status.
            $image->status = FILE_STATUS_PERMANENT;
            // Save the update.
            file_save($image);
            // Add a reference to prevent warnings.
            file_usage_add($image, 'my_theme', 'theme', 1);
        }
    }
    if (is_object($previous)) {
        if ($previous->fid !== @$image->fid) {
            file_usage_delete($previous, 'my_theme', 'theme', 1);
            file_delete($previous);
        }
    }
}

Everything works great in the theme but when I try to change any theme setting on my sub-theme I get:

Fatal error: Call to undefined function my_theme_settings_form_submit_home_back() in

Any change in the main theme works without problems.

Can you give me some idea what the problem is and help me to fix it?