texts:
I faced to problem trying drupal console:

1) In documentation written (https://www.drupal.org/docs/8/theming/twig/debugging-compiled-twig-templates):

drupal site:mode de

But I haven't that command in a list of other commands when I attempt drupal list in a project root

2) Then when I put in settings.php or settings.local.php this:

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

I got Error...

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "cache.backend.null". Did you mean one of these: "cache.backend.apcu", "cache.backend.php", "cache.backend.memory"? in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\Component\DependencyInjection\Container->get('cache.backend.null') (Line: 83)
Drupal\Core\Cache\CacheFactory->get('render')
call_user_func_array(Array, Array) (Line: 254)
Drupal\Component\DependencyInjection\Container->createService(Array, 'cache.render') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('cache.render', 1) (Line: 494)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 236)
Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware.page_cache') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('http_middleware.page_cache', 1) (Line: 494)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 236)
Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware.reverse_proxy') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('http_middleware.reverse_proxy', 1) (Line: 494)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 236)
Drupal\Component\DependencyInjection\Container->createService(Array, 'http_middleware.negotiation') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('http_middleware.negotiation', 1) (Line: 494)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 236)
Drupal\Component\DependencyInjection\Container->createService(Array, 'http_kernel') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('http_kernel') (Line: 1320)
Drupal\Core\DrupalKernel->getHttpKernel() (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

If someone resolved it please share)


texts: Drupal selectors changed after upgrading from 8.8.5 to 8.9.3

texts: I just upgraded from 8.8.5 to 8.9.3 and I am noticing some of my CSS was broken. After inspecting, I am noticing the selectors on my view have changed. Before my filter submit button was selected via data-drupal-selector="edit-submit-inventory-listing" but after updating, it now has a 2 appended to the end, thus breaking my css selector. The drupal selector now reads data-drupal-selector="edit-submit-inventory-listing-2". Any ideas? I would expect that to happen if the view was on the page twice, but its not


texts: Global Combine fields filter (Views) does not include Referenced Entities (Content Type)

texts:
I have an Content type which contains another Content type, I managed to put in place the relationships using Entity Reference I also configured Views module to display the contained content type, the problem is when creating a Global Combine fields filter I can't search with the contained Content type, it always returns an empty result.
Is something wrong with my approach ?


texts: behavior of path on unpublished/draft nodes

texts:
We have a Drupal 8 site with a press releases page. Currently the press releases page is provided by a view with a page display. The path in the page display is set to /press-releases.

I've been tasked with changing the design of the press releases page. We want to use paragraphs to allow the marketing department to edit the page. This means that I must first disable the view's press releases page display (to free up the path), then create a Basic Page (which we've added a paragraphs field to) and set its path to /press-releases.

We use configuration export, so in my feature branch, I've set the "Press Releases" view page display to be disabled when the config is imported.

To speed deployment, I've already created the "Press Releases" Basic Page on production, along with all the paragraphs that we want on it. Of course, it's not published (its current state is "Draft", which in Drupal 8, I'm not entirely certain which module provides those workflow states), because we don't want it live yet.

We use the pathauto module, so when I created the "Press Releases" Basic Page, it automatically generated the path /press-releases-0, presumably because the /press-releases path was already in use by views.

This means that, as a post-deploy step, in addition to publishing the new Press Releases node, I also have to edit the URL alias, from /press-releases-0 to /press-release (the cim command deactivates the view display).

I tried changing the URL alias on the draft node to /press-releases before it was published, but what ended up happening was that on the site, the /press-releases path returned a 404. I confirmed this by looking in the watchdog log, and, sure enough, I got an access denied at /press-releases. Finally, I published the node and cleared the cache. When I reloaded the URL, I got the Press Releases node. So it looks like the node is taking control of that path.

So my question is, is this the expected the behavior of nodes (or entities that take paths in general) in Drupal 8? And that it does this without a form validation error, or a warning or notice that an existing path was overridden? Or is this something that could be being caused by Pathauto or the Draft workflow state?

What concerns me is that any one of our editors (or even myself, as careful as I try to be) could override the URL of a view (or perhaps anything else), simply by specifying an alias for a new node.

(Also, I would prefer to be able to just publish the page in a post-deploy step. Since our deploy process involves deploying to a test and a staging environment before production, extra deploy steps are multiplied.)


texts: How do I increase the number of shortcuts allowed in admin menu?

texts:
The number of shorctuts is limited to 7 (second row)

When I add an 8th shortcut it is in the disabled section

How do I change that?


texts: Drupal SEO module - Error on the setup wizrad and on dblog

texts:
I am using all Drupal SEO module , and all recommended module with it.
I do not see any states on the Drupal SEO module reports.

When I am trying to run the setup on admin->config->search->seo tools-> "+Setup wizard", I get the following error:

  Strict warning: Only variables should be passed by reference in
  seotools_admin_setup() (line 16 of
  xx/MYusername/public_html/sites/all/modules/seotools/seotools.setup.inc).

In addition, in the dblog, I get many errors after trying to use Drupal SEO:

  TYPE    google analytics reports
  DATE    Wednesday, March 26, 2014 - 18:07
  USER    Admin   Admin-family
  LOCATION    http://www.MySite.com/admin/reports/intel/content?return_type=json&refresh=1
  REFERRER    http://www.MySite.com/admin/reports/intel/content
  MESSAGE Code: 401 - Error: Unauthorized - Message: GDatarequiredAuthorizationLogin Required
  SEVERITY    error

Drupal SEO looks like amazing module. Can you help me make it work?
how can I solve this issues the problem?


texts:
I am trying to build pages with the main menu displayed in multiple locations. A "main navigation" with top-level items A,B,C,D,E; and each of these has children a1,a2,...b1,b2,... etc.

There is a drop-down navbar menu in the header that is on every page (that displays A B C D E and when you click on any one of them, it shows its children); if you click on any child (say a2), it takes you to a url .../A/a2. That page still has the "main navigation" in the header, but also in the left sidebar it has the sub level menu of A (a1,a2,a3...) with a2 highlighted.

Someone directed me to try the menu block module, but i am not able to get it to display just A's children while in A. Depending on the options I choose for depth etc. I can either show all links (A B C D E a1 a2...e1 e2...) or all the children from all the parents (a1,a2,...,b1,b2,...,e1,e2...).

Using twig debugging, I see it's using the same template as the navbar drop-down menu, so I can't write a separate template either (or can I?)


texts: Redirect to suggestion with search api autocomplete

texts:
I'm using search api and search api autocomplete.
I want that when a user clicks on a suggestion (search api autocomplete), he will be redirected to that suggestion, not the search results.
For example, the user searches for "Node 1". He types the word in the form, sees "Node 1" in the suggestions, and clicks on it. Instead of being redirected to the result page which presents the result "Node 1", I would like it to be redirected directly to this "Node 1".
Do you know how to do it ?


texts:
I have a view of some custom content type and want to link the name of each object in the view to another view containing its details. At the moment, I have the "link this field to its node" box checked but it doesn't display it in some sort of table, just a list like Title: value.

Could you please tell me how I can achieve this?


texts:
I want to add a CSS class in hook_preprocess_html(), which indicates that logged-in users have access to the content and that anonymous users don't have access to it.

First I get the node with $node = \Drupal::request()->attributes->get('node');
and I check the anonymous users have accessto the node.

  if ($node) {
    $guest = \Drupal\user\Entity\User::getAnonymousUser();

    if (!$node->access("view", $guest)) {
      $variables['attributes']['class'][] = 'membercontent';
    }
  }

In every case, it returns TRUE. I verified $guest is a valid account and its ID is 0.
Does anybody know what is the problem with that?


texts: How do I render search block form in theme template?

texts:
I've customized the search block in "block--search-form-block.html.twig" and it works using block layout on Drupal 9. Is it possible to render the Search Block directly in page.html.twig?
I've tried this and it giving me error (The website encountered an unexpected error. Please try again later.).


texts: Why are existing entity reference fields not available to add to a media type?

texts:
I have a number of existing entity reference fields in my site. The key one is a taxonomy reference field called field_search_terms. I would like to add this field to the Document media type. However when I go to manage fields for the media type my existing fields are not available.

It looks like I need to create a new field and any search that mixes content and media will need to have two filters.

Why is this limitation in place? Is there an issue I can follow to learn more?


texts:
How can I hide those password tips???  You know,when the enduser tries toregister and as soon as he clicks on the password field the following messages appear:

To make your password stronger:
•Make it at least 6 characters
•Add lowercase letters
•Add uppercase letters
•Add numbers
•Add punctuation

Simple CSS "display:none" won't do the trick here.

I still want to keep the password strength meter.Just need to get rid of the Password tips messages.


texts: Should we use a separated database for our data set?

texts:
We are working in website and integrating the Drupal Commerce in our website. We are also adding multiple  product per product display to allow user to select products while adding product to cart.

The website will have large data set with more than 10 million product display (node) and more than 30 million products (drupal commerce).

We have also integrated apache solr with search api and allowing user to keyword search and filtering the search result.

Can anyone suggest that if we would stored such large data into single database, will it effect our performance or we need to stored data into 'master/slave' concept of database?

As we have large dataset, so we are preparing architecture of our database, so it would not effect performance of our website.


texts: Views filter on field being either empty or equal to uid

texts:
I have a views filter on a particular field being empty (Is empty (NULL)).

However, I would like to have it check on the field being either empty or equal to the current user's uid. I would like to do this programmatically in a custom module, so without installing a contributed module.

The field in question is $node->field_quality_personal[LANGUAGE_NONE][0]['value']. So this field can be either empty, or it can contain a uid.


texts:
Call to undefined function modalframe_close_dialog() in

I am using Drupal 7

function close_model_dialog($form, &$form_state) {
  ctools_include('ajax');
  ctools_include('modal');
  ctools_modal_add_js();
  $form_state['redirect'] = FALSE;
  modalframe_close_dialog();
  modalframe_child_js();
}


texts: How can I change the default branch of a contributed module?

texts:
If you're more used to GitLab than Drupal.org, you might spend a while hunting through settings there to figure out how to change the default branch - or concluding that you simply can't. I'm posting this q&a in case it saves someone else the hassle of either time waster.

Fwiw, if you are looking for the non-Drupal.org answer, see https://docs.gitlab.com/ee/user/project/repository/branches/#default-branch or https://stackoverflow.com/questions/30987216/change-default-branch-in-gitlab


texts:
I would like to have row numbers in my tr classes when displaying my view as a table. My rows seem to have only classes saying they're even and uneven.

Only possible in a tpl file?


texts: Search & replace serialized data after moving the files directory

texts:
A drupal 6 content_field_video table holds serialized data with URLs pointing to the old site location - sites/default/files/thumb.png. Moving to the otherwise amazing Aegir-based omega8 hosting platform, we moved to a new files directory,  sites/MYSITE.COM/files/thumb.png,  so we need to convert to URLs to a new scheme. Most of the URLs are corrected by the omega8 import process, but video thumbnails are hardcoded.

What's the easiest way to do it?


texts: Access imagefield file object during node create/update

texts:
I have a content type with an imagefield. I need to get a reference to the file object during node save or update, so I can do something with it.

function foo_node_presave($node){
    if ($node->type ==='foo'){
        $filename = $node->original->field_foo_image['und'][0]['filename'];
    }

In the above code, $filename isn't populated yet when a new node is being created. It does work during a node update if there was already a file in that field.

How can I get a reference to the file object in a filefield/imagefield in a hook during node creation?


texts:
Im trying to create a slide show banner for my home page in Drupal 7. I do not have enough skill to make my own or to edit the PHP, template files or JS.

So far the easiest module I have found to work with is "field slideshow" but I can only work out how to use this in content.

Does anyone know a way to enable this for use in blocks or a way to make a custom content type move to a different place than that of the main content block?

Thanks for your help!


texts: When I add the comments to each node in a Views content list am I creating a n+1 database query problem?

texts:
I have a node type product and a node type review. The review has a node reference field pointing to the node type product. Using the Node Reference URL module a user can click a link on the product page and create a review of that product. The View that renders a list of the reviews is show below the product node on the node type product view page.

I tried to add comments to the View by configuring in Views UI Format -> show -> content -> full content -> show comments. However, this did not render any of the comments. Instead I created another View of type comments using the Entity Views Attach module. So each content type review now has a field that loads a View of comments using its nid.

This works great. Still there is a now few extra queries run for each review of each product which I think is a case of the n+1 select problem.

I enabled the Devel performance logger to look at how much of a hit this causes to performance. Without rendering the extra comments and attaching them to each rendered node of type review the number of queries is 165 and the query time is 95MS (my computer is super old) with the comments rendered for each node of type review the number of queries is 189 and the query time is 111MS.

(edit) I had to hack Views to test if using the content with comments was faster than adding a different View as a field to the Review content type. Oddly the number of queries was 188 with a query time of 138MS so the slightly more convoluted method was faster.

Will I be shooting my self in the foot with a bad performance bottleneck with this configuration?

If you are having a difficult time visualizing this, it is just like Stack Exchange. With a node type question that has comments. There is node type answer that is rendered in View attached to the node type question view page. Each answer can have comments too. Same thing.


texts:
I am having the hardest time figuring out how to display multiple content types in a page using views.

In my example I have a music studio.

I have a content type for user including basic personal info

I have a content type for studio including room capabilities

And finally I have a content type for computer including hardware specs.

I'd like to have all this viewable on a page together so that when a user views a studio they see the user (engineer) and the computer information.

I'm very slightly familiar with entity ref but it appears to only show the title of the node when viewing and I'd like to have a page with composite information containing fields I select from each node/content type


texts: How to include order details in eMail notifications created with the Message module?

texts:
I am working with placing an order with the Commerce module in Drupal. When the order is confirmed, a notification will be send to the user with order details. Here I am using a rule like when an order is confirmed, customer will receive an email.

The email content will be from the Message module based on the Rules module. Also there is a content from the Commerce module regarding order details.

My doubt is that how to get this order details content from the Commerce module to this Message module content.

Below is the mail content that I saw in the backend when the rule is applied. But the content doesn't have any order details. But when the mail is received order details are present. I want to find out how to get these order details along with this content.

  Dear [message:message-commerce-order:commerce-customer-billing:commerce-customer-address:first_name], Thank you for purchasing through [site:name]. You can view your order history by logging into our website at:[message:message-commerce-order:view-url] Sincerely, Order Number: [message:message-commerce-order:order-number]


texts: How do I make a form in Add Content using Drupal 7?

texts: I am trying to get my Drupal 7 website working with PHP and an external database. I would like to have user interaction via forms, but all the examples I can find on the web hint that you have to write your own module to do this. I couldn't find a good description of even that process from the ground up. Is there a way to add a form using the standard Add Content -> Article or Basic Page? Is that a bad way to do things? I would like a page that is a form and when the user presses the submit button the same page loads, but now with the data retrieved from the database that was requested.


texts: Unity launcher / OSX Spotlight like functionality for administration?

texts:
I'm fairly certain I've seen a module that provides a quick way of typing in, for example, the title, of an administrative page, and it would wisk you away to that page.

Much like the way Unity's launcher, OSX's spotlight or KDE's runner behaves, just inside your site instead of the desktop.

However, I can't seem to recall what it was called and google only came up with this abandoned sandbox.


texts:
I'm trying to display certain blocks in taxonomy term pages and the nodes associated based on the taxonomy term itself.

Let's say I have 3 taxonomy terms: Bologna, Milan and Rome.

When I'm in Bologna taxonomy-term page I would like to display a block that show the map of Bologna, when I'm in Milan taxonomy-term page the Milan map and so on.

Context module seems to work with node associated to a particular taxonomy term (for example, I'm able to display Milan map block in every node associated with Milan taxonomy term), but doesn't work for the taxonomy page itself.

I think the trick is in Panels.
I've enabled the taxonomy-term page override but I do not know how to display blocks based on arguments.

I've used views and panels many times before but never faced this particular problem: It's a bit different that filtering with arguments particular nodes or content types.


texts:
With Drupal 7 I'm trying to use Pathauto to create aliases for images that we upload. The images are renamed with File Field Paths. An example of what I'm trying to do

What I'm trying to do

Image content type
Has an Image Field (CCK), field_image
Upload image with content type (example.jpg)
example.jpg is renamed to Ax54jk.jpg (File Field Paths)
mysite.com/node/523 is altered to mysite.com/Ax54jk (Pathauto)

I set a pattern for the Image content type of [node:field_image] which appears to yield httpmysitecomsitesdefaultfilesAx54jkjpg

So instead of creating http://mysite.com/Ax54jk, it creates http://mysite.com/httpmysitecomsitesdefaultfilesAx54jkjpg

While I was going for a unique URL, this is a bit more unique than I'd hope. Does anyone know how to accomplish what I'm looking to do?


texts: Inserting search term within "No results behavior"

texts:
Within the 'NO RESULTS BEHAVIOR' section of Views in Drupal 8 how do I output the search term along with some custom text using the "Unfiltered text" option?

My desired output is "No results found for search term, please..."

Can anyone suggest a solution?


texts: Stripping the wrappers in a custom field d7

texts:
I have a custom field in d7 and I output it as

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

The problem is it wraps around a whole load of stuff. How can I get in and edit this html?

I suspect somewhere in the field templates or using the api. I can live with the bloated html if I could get rid of the title on the a tag (title="Sample 1")


texts: Right way to add a field to be used as a filter in Views with ranges?

texts:
I need to add a field to a content type which is going to used as a exposed filter in Views.In this filter the visitor will see ranges. I've done this in the past and ended creating 2 fields to set both limits of a range. I need to remake this and I think this can be done in a smarter way.

What I need is:

1) create the content type: flat

2) add the field price to the content type flat

3) create a view Flats

4) create a exposed filter to filter by the field price but using ranges, e.g: "From 100 000 to 200 000", "From 200 001 to 300 000" and so on. I need these options to be a Select dropdown list.

Then my questions are:

about point 2): I would create a integer type field for this, is this right and enough?
about point 4): How do I do to create the ranges that I need? Maybe a module for this?


texts: Use custom metatag generated from reactjs code

texts:
I have a chart layout used in ContentTypeX Manage Display. Using reactjs, this chart is converted into an image using toDataURL process. Now I have a Rule that creates a Post content with the URL of ContentTypeX. Whenever a ContentTypeX is created, a post is also created with the URL of that ContentTypeX. My main goal is to get a preview link of this ContentTypeX URL with the image (converted chart), same how facebook works. To do this, I use metatag(opengraph).

Problem:

Using the metatag code below in reactjs, this successfully renders/displays the metatag in the header part of html.

<MetaTags>
   <meta property="og:image" content="data:image/png;base64,XXXXX" />
</MetaTags>

QUESTION:
But how can I use this custom metatag in a proper configuration. I want to have a link preview of an image in the post.

Tested:

I tried to test a regular content type Article configured with metatags and the image successfully displayed in the post. That is declaring the node fields in the content metatag. See attached image.


texts: Where to start for implementing user roles/levels?

texts:
I have three types of user roles in my site:

department heads.
department managers.
employees.

There are several department heads. Each Department Head manages multiple department managers. And each Department manager manages multiple employees.

What I want is:

Department managers should be able to see details of THEIR employees.
Department heads should be able see THEIR managers and the employees working under each of these managers.

There are lots of techniques/solutions on roles and permissions. Such as those provided by specific contributed modules (including Organic groups). But I am confused which one to start with.

Anybody can shed some light about this?


texts: REST/Services: Only able to retrieve index. Everything else result in http error 500

texts:
I am pretty new to Drupal, and I'm trying to get a webservice running on my Drupal 7 site.

For testing purposes, I made a Rest-service, with NO authentication, and all resource's added to it. I called this "test", with endpoint "test".

When accessing http://mysite.net/test/node I do get a nice list of all my nodes.
When accessing http://mysite.net/test/node/68 (or anything other than the index) I get a time-out, with http error 500 Internal server error in the headers.
I have been googling the entire day, and come up with absolutely nothing.


texts: Ajax not getting triggered on change event of selectbox field

texts:
I've tried all options to trigger an ajax event on change of a selectbox option inside form alter hook, but nothing works. Below is the sample code
$form['field_select_box']['#ajax'] =
   [
     'callback' => 'toggleOptions',
     'event' => 'change',
     'wrapper' => 'edit-field-target'
   ];

If I just try to attach the ajax event to a simple text field (like title), it WORKS.
$form['title']['widget'][0]['value']['#ajax'] =
  [
    'callback' => 'updateSubdomain',
    'disable-refocus' => FALSE,
    'event' => 'change',
    'wrapper' => 'edit-field-subdomain-0-value',
  ];

Help is appreciated


texts: How to add two separate GA accounts in one Drupal site

texts:
I have one Drupal site and I am using google analytic module for add ing GA account? Now client want to add two separate accounts.

UA-87XXX-XX
UA-87YYY-YY

How can I add these two accounts?


texts:
Plugging tokens into a block's title only shows the input text instead of what the token's supposed to output.

Is there a way to enable/use tokens in block titles, or maybe an alternative method of getting the results I want?

I've tried using Token Filter module, but it doesn't change the functionality.

I am trying to insert the [user:profile-realname] token into a block title (specifically the User Menu block title). The token is in my list of tokens available to use via HELP in the backend.


texts:
Can anybody suggest an idea how to delete redirect using rules? I have found a rules patch that allows editing redirects. https://www.drupal.org/node/1653542 but not deleting it.
Usercase: When working on an article while it is unpublished, drupal creates redirects as well. I would like to delete all redirects upon publishing a node.


texts: What is the best method for importing data?

texts: I have various spreadsheets of data to import into Drupal 8. I can create a content type for each spreadsheet. I can convert the data the spreadsheets into various formats (csv, JSON, XML, whatever). What I can't work out is what is the best way to import the data. I only need to do this one time. What is the best method?


texts: Migrating taxonomy terms only if the destination doesn't have the term name

texts:
Is it possible to migrate taxonomy terms by checking if the source term name matches with the destination term name.

I would like to skip the migration if the term is present in destination.
Tried with entity_lookup plugin, but its generating new terms.
Here is the current approach which is not working for me-

process:
  name:
   -
     plugin: entity_lookup
     source: uuid
     value_key: uuid
     bundle_key: vid
     bundle: my_bundle
     entity_type: taxonomy_term
  description: description
  vid:
    -
      plugin: log

An example would be great.
Thanks.


texts: Drush destination command not recognising

texts:
I'm able to see the destinations by using the 'bam-destinations' command and below is my script to get an entire site backup from a ftp destination (ID of this destination is 'ftp_destination' and I have entered ftp details through BAM module frontend).

drush archive-dump default http://www.example.com/ --destination=ftp_destination

For some reason it's not uploading in to the ftp location but just creates a backup called 'ftp_destination' in my local PC.

Thanks


texts:
How can I implement a zoom functionality on my content nodes? Like I need to put a zoom button next to my image and clicking it brings a floating zoomed image over the page like it's done here. I'm using Drupal Commerce.

I know that it can be done through Colorbox or Lightbox2 but these modules only function in Views (or not?). How can I put this functionality on my node (product page)?

I have themed my custom node.tpl.php template for the product display page.


texts:
I have created cusotm layout with panels on my dev and staging site. I added a class to panels region and exported using feature. Then I enabled it on stage site. But there was no changes on stage site. Is there anything more needed for panels update using features? Or have anyone a documentation on features with panels, panelizer and panopoly module?

I exported Panels: mylayout (Default Config)


texts: Why is not possible to edit page content?

texts:
I've been some time without modifying my site in drupal 7, and when I accessed it again, it was not possible to edit the page content anymore. The icon to edit the page content with panels is missing as shown below.

It is possible to edit the content of pages that don't have panels.

I am the admin, but the administrator role is not in drupal database.
I am using jquery update module, and set jquery to 1.7.
I also checked permissions to authenticated users, and it seems to be ok, once this role can create, edit and delete panels and pages.

What can I forgetting to check or update?


texts: Remove clearfix from section class in custom theme

texts:
I'm attempting to edit the template for my pages to allow it to show the content with a block beside it rather than beneath it. I'm currently using bootstrap to lay out my grid.

In my page.tpl.php I have

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

    <?php print render($page['sideblock']); ?>

I want the content block and the sideblock to be side by side. However when the page renders it wraps the content block in

I noticed that when I removed the clearfix class to the section tag I was able to display it side by side. But I don't see any method to remove the clearfix class from this.


texts:
I'm using drupal 7, feeds 7.x-2.0-alpha8. How to skip (don't update) some fields from existing node during import if this field already has a value?

i.e. We periodically import some products with photo (create new and update existing). After that editor can change photo. How can I skip this photo field during next update?

There is some feeds tamper plugin to check is field in updating node is empty? Maybe there is some hook from feeds or feeds tamper?


texts: Transition plan for PHP5 abomination to Drupal

texts:
Background

A year from now my clients are going to port a relatively complex intranet portal service (scheduling, actual tracking and reporting, and more) to Drupal because the head office says so. Very little effort has been made to determine if this is the right technical choice and it is beyond the control of my client's or even their bosses.

The current portal is an abomination that is in the process of being re-factored and I believe the most cost effective plan will be to bring in a domain model layer via Doctrine 2 and put 99.9% of all business & input validation logic into the models, gutting out the abomination until it is a skeletal view & authentication logic layer.

Question

For any Drupal specialist out there, does this seem like a viable approach? Could Doctrine2 play nice with Drupal or does Drupal higher level logic need a much tighter integration to the data?


texts: Why am I getting a PDO Exception error when I try to run Drupal Console inside the root directory?

texts:
I've installed Drupal Console and can confirm it is in the proper directory, etc.

I run the command "Drupal" from my home directory and I see a Drupal Console help list of commands, but when I run it inside my site root directory, I get a PDO Exception error. I can't figure this one out. Should I move Drupal Console into my Drupal site directory? Thanks for the help.


texts: Removing div wrapper of textfield element in webform

texts:
I would like to remove div element on webform textfield.
Instead of :

<div class="form-item webform-component webform-component-textfield" id="webform-component-vous-etes--nom">
  <input type="text" id="edit-submitted-vous-etes-nom" name="submitted[vous_etes][nom]" value="" size="60" maxlength="128" class="form-text">
</div>

I would like to have this :

<input type="text" id="edit-submitted-vous-etes-nom" name="submitted[vous_etes][nom]" value="" size="60" maxlength="128" class="form-text">


texts: Creating a Date Field that will display 'Year' to 'Current'

texts: I want to create a field that will ask the user for the date they started their job to when they left. If they are still currently working at the job, the user will click 'I currently work there' or something similar.   The date module currently can be setup to have a 'to' and 'from' field.  The tricky part is how do I save 'Current/Present' to the database.  How do I go about this?


texts: How can I have profile edit pages displayed in admin theme?

texts:
Drupal 8- How to use admin theme for user profile edit page while editing the profile by an administrator.

Example: when admin takes the URL: www.mysite/profile/{id}/edit (This is the URL you get when admin edit a user profile from user profile list.) I need to show the edit form in admin theme

I am using below profile module

version: '8.x-1.0-rc6'

core: '8.x'

project: 'profile'


texts: Is there a way to see what fields are used in Rules?

texts:
There is an field list overview in the reports for Views that shows the fields used.

Here is a sample of it:

Is there a quick way to find out which fields are used with Rules? It would be enough to check if a certain field is used by Rules.

SOLUTION:

As I don't have a special SQL tool drush works too by entering a query similar to what's included in the accepted answer:

drush sqlq "SELECT id,plugin,active,name,label FROM rules_config WHERE data LIKE '%points_dec%'"


texts: Recursive Group->Subgroup content (entity reference) relationship with Organic Groups and views

texts:
I have Organic Groups in Drupal 7 setup. I have two OG content types: Topic and Project. Topic is a regular OG group. Topic is both an OG Group and Group Content, so it is a subgroup, which can reference Topic.
I have a panel page setup that displays the Topic groups nicely, including a view that displays all content that is a member of that specific Topic group. This (as intended) also lists all Project groups that are a member of the specific Topic.

Now the question: is it also possible to add recursion to this Group Content view, where I don't only show the content that is a member of the particular Topic, but also of the child Projects of the Topic.

If I understand correctly the Group memberships depend on entity reference, so this would boil down to views being able to recurse through entity references.

I hope this is possible because it would greatly improve the user experience of my site where now a user has to both reference the subgroup and the parent group if they add content to a subgroup, in order for it to show up on the parent group.


texts:
I added a button to the page. I'm trying to get the values of the field when I click the button. But I can not understand how to access the node from submit? Am I on the right track or should I look for another solution? I tried to add $node to the function redirect_button_form_submit but this does not work.

function show_on_map_node_view($node, $view_mode, $langcode) {
    $url = url(current_path(), array('absolute' => TRUE));
  if (($node->type == 'addproblem') && (strpos($url, "problem"))) {
    $form = drupal_get_form('redirect_button_form');
    $node->content['redirect_button'] = $form;
 }
}

function redirect_button_form($form, &$form_submit) {
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Show on map'),
    );
    return $form;
}

function redirect_button_form_submit($form, &$form_state) {
//How to access the $node here?

    $geofield = field_get_items('node', $node, 'field_location_exif');
    $location = array(lat => $geofield[0][lat], lon => $geofield[0][lon]);
    $path = '<front>';
    $options = array('query' => $location);
    drupal_goto($path, $options);
}


texts:
I want to add in a contextual link to a block.

The block shows up in different pages, not just a specific page.

Here is my current setup

$block['content'] =array(
    '#markup' => _get_markup(),
    '#attached' => array(
        'css' => array(
            drupal_get_path('module', 'module_name') . '/css/main.css',
        ),
        'js' => array(
            drupal_get_path('module', 'module_name') . '/js/main.js'
        ),
    ),
    '#contextual_links' => array(
        'add content' => array('add/content/', array('content')),
    ),
);

Based on the documentation, this should work for drupal 7 but it does not for me.


texts: basics of settings.php and settings.local.php?

texts:
What is the up-to-date basic workflow regarding database credentials when you launch a local version of a site that is already operating remotely?

What are the considerations and how is each best addressed? Are there advanced considerations that might require one to vary the basic approach?

Thoughtful confirmations of the community's understanding welcomed. (As appropriate) I'll happily help kick off documentation. It appears not to be documented clearly elsewhere, though if someone else has seen clear documentation on each point of the workflow and related decisions, please include links in your remarks.

UPDATE:

As promised above, I've started working on improving drupal docs. I've opened an issue https://www.drupal.org/project/user_guide/issues/3013725


texts: Change frontpage pagination to use a more/previous style

texts:
The standard pagination on my site looks like this:

I'd like to alter the config (or install a module, etc) that will help me use this simpler type of pagination:

How can I reconfigure my site to use this kind of pagination? Do you know of a module that will let me choose this style?


texts: How do I send a privatemsg to all users that have flagged a node using Rules?

texts:
I am using the Privatemsg module, Flag module and Rules module.

I wonder if using Rules I could send a private message to all the people who have flagged a specific node when a new comment is posted.

Thus, the flag would act like a subscription for new comments notification.


texts:
In a views template, I need to check if the views rows are grouped. Which property of the $view object contains this information?

In the example below, $grouped = !empty($options['grouping'][0]); seems to work. However I don't know/understand all details about the $view object and I'm not sure if this really is a solid solution. Will this work in all situations?

Currently, my views-view-unformatted.tpl.php looks like this:

<?php
$grouped = !empty($options['grouping'][0]);
$heading_classes = $grouped ? ' class="group-heading"' : '';
?>

<?php if ($grouped): ?>

<?php endif; ?>

<?php if (!empty($title)): ?>
  <h3<?php print $heading_classes; ?>><?php print $title; ?>

<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
  <div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"';  } ?>>
    <?php print $row; ?>

<?php endforeach; ?>

<?php if ($grouped): ?>

<?php endif; ?>


texts: How to log simpletest test results into files using drush test-run?

texts:
I would like to save simpletest test results into a log file. What bash commands should I use ?

I tried this command (example) but nothing is saved into /var/tmp folder :

sudo -u apache drush test-run Comment --xml /var/tmp

I use Linux , Drupal 7.12, Drush 4.5


texts: How to show block based on browser language?

texts:
In Drupal 8, I would like to show a block to a visitor based on their browser language (I guess based on the Accept-Language HTTP header).

The page should stay in English but there should be something like "this site is available in your language, click here" (translated into the relevant language, of course).


texts:
I have a client where they have an integrated form from another website.  For some reason the Drupal 7 captcha module will not work on this form when entering it into captcha settings.  The form id="contact-form" and then in the captcha setting I put contact_form.  This works on any other form that is either created with webform or and drupal module but will not work when the custom form is put into the content section of the page.

Any ideas?


texts: Maintenance mode says it's on, but site is still available

texts:
Before attempting to do some module updates, I enabled maintenance mode on the site. I then noticed that the site was still available to all visitors, even though the Configuration->Development->Maintenance Mode page said that maintenance mode was enabled.

I have cleared all caches (via admin pages and drush) several times already, and have checked the settings.php file to see if there was a manual override set. I have also turned the setting on/off several times, logged out and logged back in, etc.

I've never seen this happen before. What else can I try?


texts:
I have a problem where Drupal tries to access the files in the "styles/stylename" directory, but they are not there since they aren't beeing generated. I allready tried changing the theme for a while (image style (imagecache) images are not being created) and also tried creating the style folder, changing permission and editing the .htacces file (https://www.drupal.org/forum/support/post-installation/2015-06-16/image-styles-not-generating#comment-11859066). I also tried a few other things, nothing seems to work.
Maybe usefull information: the images are created in a directory based on the month and year.
 for example "sites/default/files/2019-07/filename.png"

edit:
When accessing the url of the image style it returns:

  Error: Class 'lsolesen\pel\PelJpeg' not found in Drupal\file_mdm_exif\Plugin\FileMetadata\Exif->getFile() (line 108 of modules/file_mdm/file_mdm_exif/src/Plugin/FileMetadata/Exif.php).
      Drupal\file_mdm_exif\Plugin\FileMetadata\Exif->getFile() (Line: 127)
      Drupal\file_mdm_exif\Plugin\FileMetadata\Exif->doGetMetadataFromFile() (Line: 280)
      Drupal\file_mdm\Plugin\FileMetadata\FileMetadataPluginBase->loadMetadataFromFile() (Line: 377)
      Drupal\file_mdm\Plugin\FileMetadata\FileMetadataPluginBase->getMetadata('Orientation') (Line: 183)
      Drupal\file_mdm\FileMetadata->getMetadata('exif', 'Orientation') (Line: 39)
      Drupal\image_effects\Plugin\ImageToolkit\Operation\gd\AutoOrient->execute(Array) (Line: 172)
      Drupal\Core\ImageToolkit\ImageToolkitOperationBase->apply(Array) (Line: 124)
      Drupal\Core\ImageToolkit\ImageToolkitBase->apply('auto_orient', Array) (Line: 143)
      Drupal\Core\Image\Image->apply('auto_orient') (Line: 138)
      Drupal\image_effects\Plugin\ImageEffect\AutoOrientImageEffect->applyEffect(Object) (Line: 302)
      Drupal\image\Entity\ImageStyle->createDerivative('public://2018-05/02_1.jpg', 'public://styles/project_gallery_image/public/2018-05/02_1.jpg') (Line: 161)
      Drupal\image\Controller\ImageStyleDownloadController->deliver(Object, 'public', Object)
      call_user_func_array(Array, Array) (Line: 123)
      Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 582)
      Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
      Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
      Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 151)
      Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
      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: 99)
      Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
      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: 693)
      Drupal\Core\DrupalKernel->handle(Object) (Line: 19)


texts: How do I programmatically set the view title?

texts:
In D8, I have a need to dynamically set the title of a views page display.

I've tried implementing both hook_views_pre_render and hook_views_post_build and setting the value of $view->build_info['title'], but Drupal seems to be ignoring it when setting the page title.

It seems like the code in Views where the title is set is in Drupal\views\Plugin\views\display\Page::execute()

The #title property on the render array in that method IS receiving my overwritten value from one of my hooks, but it's still ignore and is using the manually specified title on the display config.

What is going on!?


texts: Problem with Drupal 6 built in "normal" caching - users getting data several days old on front page

texts:
I have a site running Drupal 6. I was having performance problems so I turned on Drupal's built in "normal" level of caching performance -- which claims to not have any side effects.

Since I enabled this feature (about 3 days ago) I have users reporting that they are not seeing the latest content -- specifically the latest posts on the front page appear to be from several days ago. I believe this is happening both for logged in users, and anonymous users. I have not yet seen it happen as either a logged in user or an anonymous user.

What might be causing this and what steps can I take to troubleshoot it?


texts:
I installed Drupal on my localhost (LAMP Stack), and I am trying to install modules, but I get the following error.

I tried changing the permissions of the folder, but still it is not working. It is showing same error from both the methods of installation.


texts: How to disable a troublesome module that causes admin/modules to not list all modules?

texts:
I ran into an unexpected situation after installing the 7.x-2.1 of the Multilang - Embed multiple translations inside a unique node or block module. I was actually experimenting with that module to better understand the question about Why is the recommended release of my module not proposed in Drupal updates?

After I finished experimenting with that (version of that) module, I wanted to disable it again, via the typical admin/modules link. The link still worked (so no WSOD situation like you may get if you run into memory problems), but not even 1 module (enabled or disabled) was shown in my module list. So no way to "disable" that Multilang module from there.

How can I disable this module without using the admin/modules link (since there it doesn't show up)?


texts: I'm unable to select and saveany text filters except for "Filtered HTML".

texts: I've tried to edit a field in a few content types to set the filtered text format to something other than filtered html, but after I save, it has no effect. I go back to the content type, and it's back to filtered HMTL. If I select "Plain Text" form the "Text processing" setting, I can pick plain text in the "Text format" dropdown, but otherwise, it always saves back to "Filtered HTML". What am I doing wrong?


texts: How to set Disqus Share link to window.location.pathname + window.location.search?

texts:
Version Disqus 8.x-1.0-rc3
Drupal 8.2.5

I have a page that is built up of multiple nodes using Twig Tweaks.  One of the nodes has the Disqus comment field.  Module runs smoothly and everything, however, the Share url is to the node/#### instead of the page.

Tried the following but to no avail:

Updated the Disqus field's default identifier to [current-page:url].
Overrode the node's Disque identifier manually on /node/####/edit page
Tried modifying modules/disqus/js/disqus.js (w/drush cr), so that

disqus_title = document.title;
disqus_identifier = window.location.pathname + window.location.search;

I thought #2 would work above, but it still is tied to the entity's node id.  The Share link always goes to /node/####.

Any assistance in this matter would be greatly appreciated.

EDIT: Just noticed that [current-page:url] does not include the search portion of the url.  The URL looks like /something/node-title-text-here?page=5


texts: Add custom text as a label in front of RSS feed icon

texts:
I want to change the label from "Subscribe to News" to "Subscribe to News Feed" displayed with RSS icon in drupal8. Also I need to open a popup window on clicking icon.

Attaching the screenshot:

Any help to figure this out?


texts: How to write custom access for a route which redirects the user to another route if a condition is true

texts:
If I visit example.route.one and certain conditions are fulfilled I want to redirect it to example.route.two OR else access should be allowed.
How Can I achieve this? I tried writing the redirection in the custom controller routeOne but this method does not work properly for non-admin users, the issue being if I click/visit example.route it automatically redirects me to example.route.two
Menu Yml file - example.links.menu.yml
example.route:
  title: 'Route Example'
  route_name: example.route
  parent: system.admin
  description: 'Contains Route Example'
  weight: -99

example.route.one:
  title: 'Route One'
  route_name: example.route.one
  description: 'Route one example'
  parent: example.route
  weight: 1

example.route.two:
  title: 'Route Two'
  route_name: example.route.two
  description: 'Route two example'
  parent: example.route
  weight: 2

Routing File - exmaple.routing.yml
example.route:
  path: '/admin/route'
  defaults:
    _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
    _title: 'Route Example'
  requirements:
    _access: 'TRUE'

example.route.one:
  path: '/admin/route/one'
  defaults:
    _title: 'Route one'
    _controller: '\Drupal\example\Controller\ExampleController::contentOne'
  requirements:
    _custom_access: '\Drupal\example\Controller\ExampleController::routeOne'
  options:
    _admin_route: TRUE

example.route.two:
  path: '/admin/route/two'
  defaults:
    _title: 'Route two'
    _controller: '\Drupal\example\Controller\ExampleController::contentTwo'
  requirements:
    _custom_access: '\Drupal\example\Controller\ExampleController::routeTwo'
  options:
    _admin_route: TRUE

Controller for custom access - ExampleController.php
<?php

namespace Drupal\example\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Access\AccessResult;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Drupal\Core\Url;

/**
 * Defines a route controller .
 */
class ExampleController extends ControllerBase {

  /**
   * {@inheritdoc}
   */
  public function routeOne() {
    if (TRUE) {
      $response = new RedirectResponse(Url::fromRoute('example.route.two')->setAbsolute()->toString());
      $response->send();
      return AccessResult::forbidden();
    }
    else {
      return AccessResult::allowed();
    }
  }

  /**
   * {@inheritdoc}
   */
  public function routeTwo() {
    return AccessResult::allowed();
  }

  /**
   * {@inheritdoc}
   */
  public function contentOne() {
    return [
      '#type' => 'markup',
      '#markup' => $this->t("hello route one"),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function contentTwo() {
    return [
      '#type' => 'markup',
      '#markup' => $this->t("hello route two"),
    ];
  }

}


texts: How to check if a url exists on my own website

texts: I need to check if a url exists in a module that I am creating.  How should I go about doing this? I tried to use a @get_headers() function with php, but sadly that doesn't work. I am wondering if there is a built in drupal function that I can use?


texts: Why is data-quickedit-entity being printed in plain text when I'm signed in?

texts:
I have a template for theming paragraph sections that, for some reason, prints out data-quickedit-entity-id="paragraph/2" in plaintext above any of my paragraphs that contain images.

{% set bgcolor = content.field_background_colour[0]["#markup"] ?: color_class %}
{% set bundle = paragraph.bundle ?: base_class %}
{% set image = content.field_section_image|without("label") %}
{%
  set classes = [
    "paragraph"|clean_class,
    "paragraph--" ~ bundle|clean_class,
    "paragraph--" ~ bundle|clean_class ~ "--" ~ bgcolor|clean_class,
  ]
%}
{{kint(attributes)}}
{% if attributes %}

{% else %}

{% endif %}

{% if content %}
  {{ content.field_main_heading }}
    {% if content.field_sub_heading %}
      {{ content.field_sub_heading }}
    {% endif %}
    {% if content.field_section_image["#title"] %}
    {{ attributes.removeClass(classes) }}
      {% include "@base/layouts/grid/00-grid.twig" with {
        items: [image, content.field_body_text],
        grid_base_class: "grid",
        grid_modifiers: ["columns-2"]
        } %}
    {% else %}
      {{ content.field_body_text }}
    {% endif %}
{% else %}
  {{ dummy_content|raw }}
{% endif %}

This happens right above the image, inside the  on line 18. Screenshot below:

It only gets output when logged in as it's obviously something to do with the quickedit system.

Has anyone seen this or can advise on how to prevent it?


texts: How to display legal link on registration page in colorbox node?

texts:
I have installed the module Legal and choose to have a checkbox on registration. On registration of a new user is then displayed:

Accept Terms & Conditions of Use *

The Terms & Conditions are link to page /legal in the same window.

I want to show this link in colorbox node so a style should be appended. Probably I have to modify the code (which I do not prefer) or can implement a hook for this? If so, how?

Any other suggestion?


texts:
Let's say I have 3 products in a product display that cost $5.00, $3.00, $7.00.

Right now in Commerce Kickstart 2, the view displays the first product's price which happens to be $5.00.

I would like the View to display the price range, $3.00 - $7.00, but only if there is a variance in prices (if all the products are $3.00 - just display $3.00).


texts: How do I get the email of the one submitting contact form in the "reply to"?

texts:
Drupal 8 site. I'm using the core Contact module for basic "Contact Us" form.

How can I get the email of the person submitting the form to be in the From field? And a follow-up: How do I get the email of an authenticated user to show in the body along with the username?

Site and users:

The site is an association website. There are about 100 user accounts.

Domain and email:

The site domain is not the same as the email domain in account settings: the site is theirsite.org and the email is theiremail@gmail.com

From & To in email

When the email came in from authenticated user or anonymous user, the From and the To are both showing theiremail@gmail.com - the site email.

What shows in body of email:

The email from the authenticated user does not show in the body of email; only the user name and the link to their user account /user/[user-number]

When I submit a form as an anonymous user the email does show in the body.

P.S. I do not want to use the Webform module.


texts:
I have an issue that needs the help of everyone. I created the page in view to filter the node. I created a filter Date created in "view exposed filter" for filter by  Date created.

I configured for the Filter granularity is check month,  that filter will display 2 dropbox to me to choose, i.e. month and year dropbox. But I want to change label in this two dropbox. Example: "- Month -" replace for "-Month". Do not know if anyone can help me handle the matter.


texts: textfield with #disabled = true, #input = false

texts:
A textfield with #disabled = TRUE will appear greyed out, and be unchangeable.

A textfield with #input = FALSE will not send its value to $form_state['values'], and will be ignored by system_settings_form_submit().

Unfortunately, a textfield with #disabled = TRUE and #input = FALSE no longer appears greyed out.

I want to make a textfield that is purely for display purposes, so a person can copy a value from there. What is the best way to do this?

EDIT I: What I tried so far

To clarify, my starting point is code like this:

$form['thetext'] = [
  '#type' => 'textfield',
  '#title' => t('The text'),
  '#disabled' => true,  // This should make it greyed out - but it doesn't due to #input = false below.
  '#input' => false,  // This should make this field ignored in $form_state['values'].
  '#value' => 'xyz',  // Either #value or #default_value.
];

EDIT II:

If this wasn't clear before: I really want the html output to be a textfield element. I also want to use the regular form + theme API, so that the element gets a label and wrapper div and theming like other form elements in the same form. E.g. if I would just hardcode the textfield html, it would no longer have the same classes, wrappers etc.


texts: How do I add embedded YouTube videos in a field?

texts: I would like to have a field for adding YouTube videos; however, I do not want to use the Media module because it is very buggy at this point. Is there any alternative for Drupal 7?


texts: Drupal 7 Error 324 (net::ERR_EMPTY_RESPONSE)

texts:
I am working on a new Drupal 7 site and I am randomly getting connection errors to my server.

I am getting "Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data." in Chrome and Connection reset Errors in firefox. They are sporadic and tough to replicate. I call my service provider (MediaTemple) and they are unable to replicate the problem.

I am honestly at a loss and will look into any ideas given.


texts: How to display a field before node title?

texts:
I'm looking to render a certain field before the node's title when displaying a teaser in D7.

Effectively I want to go from this to this.

I have looked into updating the node.tpl.php but I notice that it separates $title from  $content so I'm unsure how to approach this. After some searching I have found that people have suggested using CCK and ConTemplate modules to get around this in Drupal-6 but I'm wondering if there is a more Drupal-7 solution.

Any suggestions?


texts: How to sync one menu item into other menus?

texts:
I have a Drupal menu called Top-Nav which I use for my Top Navigation with the following 6 menu items(for example)

Home   a    b    c    d    e

Each of a, b, c, d and e have sub items.
I also have 5 other menus let's say named "menu1", "menu2", "menu3", "menu4", "menu5" that have exactly the same structure/items as a, b, c, d, e
Like "menu1" is the same as "a", "menu2" is the same as "b" ...

What I am trying to achieve is the following:
When the admin adds a new item to "a" section of Top-Nav i want to replicated that item in "menu1" programmatically, I want to sync them once the new link is added.


texts: Why is accessing paragraphs slow? Is there a better approach?

texts:
I'm trying to get the target_revision_id of a paragraph within a paragraph within a node. I can do this, but it is slow.

$all_nodes = db_select('node','e')->fields('e',array('nid'));
$all_nodes->condition('type','author');
$data = $all_nodes->execute();
$the_result = $data->fetchAll(\PDO::FETCH_ASSOC);
foreach ($the_result as $node){
    $node_load =  \Drupal\node\Entity\Node::load($node['nid']);
    foreach ($node_load->field_paragraphs as $item) {
      $para_id = $item->entity->field_affiliation_details->target_revision_id;
      //then, store the para_ids in some array
      $para_ids[] = $para_id;
    }
}

Performing the reference "$item->entity" makes my app slow down by a lot. It is really just Kilobytes of data. Is there maybe a better approach to this?

Thanks for any help.


texts: How to make a comment only visible to the commenter before approval?

texts:
There is no registered users (apart from user/1 of course ...) in the website and anonymous visitors have the permission to comment on the website.

Comments are not shown before approval.

What I want to do is to display a comment to commenter only before I approve it. So this is what I'm looking for:

  Only display a comment posted by 'X' to 'X' (nobody else) for as long
  as the comment has not been approved by a reviewer, AND on condition X
  is using the same browser as the one the comment got posted with.

I couldn't use "userid" etc. for (anonymous) visitors. What can be used for that (session, IP address etc.)?

The feature I asked for is similar to the peer review feature you see on any SE site, which is like so:

How can I do it?


texts: I have created a view that lists all the nodes of a certain type. If you go to view the node on it's own page I would like it to forward to my view. I tried doing this using rules but as I display the full nodes in my view it created a loop. I could give all my nodes a /nodetype/title path if I can set up some wildcard redirect.


texts: List field: translated values are not translated

texts:
In my Drupal 8 project I have some list fields. For example maybe a field "project type" with the following key|values, coming from the original language German:

1 -> öffentliches Projekt
2 -> privates Projekt

Which I translated in the field's settings:

1 -> public project
2 -> private project

The field is NOT set to be translatable because the value should not be changed in a translation: the project type is in all languages the same! But now when I go to the node edit page, when I view the node or when I add this field as exposed filter to views I always see the German values of the field no matter what is set as the current language of the page. When I change the field to be translatable the value of the list field can be changed in English translation -> so it can come that a project is "public" in German and "private" in English what is not the desired result.

How do I get the translated values of a list field to be used in form element and node view when the list field itself should not be translatable?


texts: How to reference existing taxonomy terms in a migration

texts:
I'm trying to migrate nodes with a term reference field.  The terms are not migrated and already exist in the destination site.  There is a method in the migration class which is confirmed to already select the correct term ID on the new site.

When the migration is run an error appears:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'migration_db.taxonomy_index' doesn't exist:    [error]
SELECT 1 AS expression
FROM
{taxonomy_index} taxonomy_index
WHERE ( (nid = :db_condition_placeholder_0) AND (tid = :db_condition_placeholder_1) AND (status =
:db_condition_placeholder_2) ); Array
(
    [:db_condition_placeholder_0] => 2290
    [:db_condition_placeholder_1] => 4
    [:db_condition_placeholder_2] => 1
)
 (/home/vagrant/docroot/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php:770)

The migration appears to be trying to get the term data from the migration database instead of the destination (default) database.

migrate plus yml:

...
process:
  field_section: Section
...

migration class:

class MyNodeMigration extends SqlBase {
  public function query() {
    return $this->select('TableA', 'ta')
      ->fields('ta', ['Id', 'Body', 'OriginalId']);
  }
 ...
  public function prepareRow(Row $row) {
    $row->setSourceProperty('Section', $this->convertToTermId($row->getSourceProperty('OriginalId'));
  }

  public function convertToTermId($original_id) {
    return $this->getDatabase()->select('TableB', 'tb')
      ->fields('tb', ['DrupalTermId'])
      ->condition('OldId', $original_id)
      ->execute()
      ->fetchField();
  }
}

-------------UPDATE-------------

I've also tried using a custom plugin.  The same error occurs.
Plugin class:

/**
 *
 * @MigrateProcessPlugin(
 *   id = "existing_term"
 * )
 */
class MigrateProcessExistingTerm extends ProcessPluginBase {
  /**
   * {@inheritdoc}
   */
  public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    $term = Term::load($value);
    return [
      'target_id' => $term->id(),
    ];
  }

}

Updated yml:

...
process:
  field_section:
    plugin: existing_term
    source: Section
...


texts: How can I change the precision in the decimal field of CCK?

texts:
I have a decimal field.  The field has a minimum precision of 10. Can I change this precision?  I need that the numbers allowed have the next format:  19.1, 20.3.  In other words that the number be  of  2 integers and one decimal.

I select one decimal in the configuration of the decimal field , however the field accepts big numbers.  How can I change this, the solution can be with form_alter.

Thanks.


texts: How to let the user enter the price for particular product in Commerce Kickstart?

texts:
I have installed Commerce Kickstart (version 7.x-2.25).

I have to set the price as 100 Rs. At the same time user will enter an amount above 100rs.

Is there any option for the user to enter the price and go to cart and checkout page?


texts:
In Drupal 8, I am creating functional tests extending the BrowserTestBase class.

Launching a test though (even an empty one) requires about 2-3 minutes.

Is this normal, is it there a way to speed up the functional tests?


texts: How to programmatically associate a taxonomy term to a field

texts:
I'm trying to import user profiles data from a JSON file. Several fields are entity reference to vocabularies.
I'm able to create a new taxonomy term entity in the universities vocabulary bundle using the following code:
$term = Term::create([
  'name' => "University of Bologna",
  'vid' => 'universities',
])->save();

Now I have to link this newly created term to a field contained in Profile Type. I'm testing the following code.
    $values = array(
        'type' => 'profile_type',
        'uid' => 3043,
    );
    $profileStorage = \Drupal::entityTypeManager()->getStorage('profile');
    $profileEntity = $profileStorage->create($values);
    $profileEntity->field_entry_university->appendItem($term);
    $profileEntity->save();

However, this approach doesn't work. How can I fix it?


texts: Access image/file with REST and Basic Authentication

texts:
I'm trying to access images/files in Drupal 8 through REST. They are only accessible for authorized users. I'm able to get the URL to the files, but when I try to load them using Basic Authentication, I get a 403 error.

Using cookies, I'm able to access the files after login, but I'd prefer to use Basic Authentication.

Is there any way to accomplish this?

Thanks.


texts:
Where can I find Premium Responsive Drupal 6 themes?

(CSS defined in such a way that the same stylesheet is used on mobile and desktop)

It must be Drupal 6 because I am using it with drupal-cod.


texts: hook_validate() returns errors, but the form has lost all the user's submitted values

texts:
I'm sure there's a standard Drupal way of doing this, but I've tried a couple of the statements that I've found on blogs and stuff, and I can't get a form to restore the values submitted by the users.

For example:

form default value: "enter a long word"
user submits: "foo"
validation sets: "word not long enough"
form displayed on page with value: "enter a long word"
expected value: "foo"

So far, in the hook_nameform_validate function, I've tried setting form_state['rebuild'] and form_state['redirect'] to FALSE (I've seen both listed in blogs as the right answer).
Perhaps unsurprisingly to anyone who knows the correct answer, neither works individually, nor do they both work together.

EDIT as requested, here is some actual code to show what I'm doing (wrong).  You're correct that the question was probably too general to be of value without any actual code on display. This sample is still "abstracted" - there's closer to a dozen fields, but the effect is the same.

In this case, with these functions (and the others, like theme etc...) when a user submits their email address, if the validation returns an error, the form tells them "bad user" then clears the email field (and all others).  Ideally the form should repopulate all fields with any typing they've already done.

function sampleform_nameform($form, &$form_state) {
    $d = sampleform_defaults();
    $form = array(
        '#method'                   => 'post',
        '#prefix'                   => $d['form_prefix'].'
',
        '#suffix'                   => '
'.$d['form_suffix'],
        'your_email'                => array(
            '#value'            => $d['your_email'],
            '#type'             => 'textfield',
            '#field_suffix'         => '*',
            '#required'             => TRUE,
            '#attributes'           => array('class' => array('standardInput'),
                                             'default' => $d['your_email'])
        ),
        'sampleform_submit'         => array(
            '#prefix'               => $d['clear'],
            '#type'                 => 'submit',
            '#value'                => $d['submit'],
            '#attributes'           => array('class' => array('buttonInput', 'submitInput')),
            '#executes_submit_callback' => true
        )
    );
    return $form;
}

function sampleform_nameform_validate($form, &$form_state){
    $d = sampleform_defaults();
    if (!valid_email_address($form_state['input']['your_email'])) {
        form_set_error('your_email', $d['e_email_v']);
    }
}

It's very possible that one of the two answers below has fixed the issue, and I've not had the chance to read them yet, so with a few more minutes, maybe we'l find the answer is already here.

:)

EDIT 2

kiamlaluno has shown us that while I was using #value in my form-builder function, the correct nondestructive setting in creation of a form is #default_value

If I look back to my original reference point, Pro Drupal 7 Development the form API examples in chapter 11 give the instruction to use #value on page 247 (where you build your first form).

They also use MODULENAME_nameform as the hook, while it appears to be more correct to use MODULENAME_form (according to the way drupal works, it's easier to find further documentation if you search for _form rather than nameform).

Anyways,  hopefully this saves someone else some time.  Someone should probably tell Todd Tomlinson and John K VanDyk that they've got an error in their book.

:)


texts: How can I display "new" or "update" in the view that overrides admin/content/node?

texts:
I have override the page admin/content/node with Views.
The default page of admin/content/node displays "new" for new contents and "updated" for updated contents. How can I display them in the custom View?


texts:
My requirement is to add cancel button to AJAX file upload. I know how to add Cancel button when upload starts but how can I get current XHR object to call abort() method on it?

Current code:

(function ($) {

    Drupal.behaviors.rpke_cancel_btn = {
        attach: function (context, settings) {
            var el = Drupal.ajax['edit-xml-file-upload-button'];
            el.options.beforeSubmit = function (form_values, element, options) {
                $(el.element).parent().append($('<input>').attr({
                    'type' : 'button',
                    'value': Drupal.t('Cancel')
                }).click(function() {
                        //need the way to obtain XHR object here
                    }))
            }
        }
    };
})(jQuery);

I tried:

 Drupal.ajax['edit-xml-file-upload-button'].ajaxing = false;

but it does not work :(

[EDIT]

Now I think this is not possible because Drupal does not store XHR object returned by $.ajax()


texts: Multiple hook_menu_alter over-writing issue

texts:
I want to customize my menu by using hook_menu_alter by over-writing another installed module, which also has a hook_menu_alter inside.

I check the procedure using xdebug, finding that drupal execute my hook_menu_alter first, and then the existing hook_menu_alter in that module. In this case all my alteration is being over-written. How can I reverse the order of execution?

Thanks!


texts: What is the path for form elements which are ajax-enabled

texts:
I am working on the quiz module.
I have to modify the form node/add/multichoice by hiding some of the form elements in it.
With the help of krumo function of devel module, I am able to find the correct form elements and set ['#access'] to FALSE in order to hide them.
All this is done in a custom module using the hook_form_alter().

But the problem is that I have to hide advanced fieldset under alternatives.
The path for form element for advanced fieldset is thus like below :
$form['alternatives'][0]['advanced']
$form['alternatives'][1]['advanced']
But there is an option of add more alternatives.
What is the path for form elements which are ajax enabled.


texts: Display username in user.html.twig template

texts:
How can I show the display name from my theme's user.html.twig template?

I have tried {{ content.display_name }}, {{ content.field_display_name }} and I am open to setting a Twig variable or preprocessing in the .theme file, but I need help.


texts: Change page URL structure based on node field value

texts:
I'm using Pathauto to produce nice URLs for my Drupal 7 site, and have run into the need to edit the URLs based on a node field value.

Specifically, when the content is archived on my website, the URL needs to be automatically changed to include the substring 'archive'. So when editing this page:

www.mysite.com/mypage

and node:field-status is changed from none to archived, I need the URL to become:

www.mysite.com/archive/mypage

Also, pages that already feature a substring, such as mysite.com/blog/mypage would ideally have the new substring prepended to the relative URL, so:

www.mysite.com/archive/blog/mypage

I have tried using Flags and Rules to rewrite the URL pattern based on the field value, but with no luck. Any ideas?


texts: Webform Attach InvokeCommand to default ajax submit callback

texts:
I need to be able to do a call to the CRM upon form completion in the front-end/javascript.
How can I add a command to be executed on submit of a webform without overriding the default behaviour? Is it possible to do it via a form handler ?


texts:
I need to collect comments that belong to certain user and submitted on pages of certain content type nodes. Currently I'm making two queries:
      $nodes = db_select('node', 'n')
      ->fields('n', array('nid'))
      ->execute()->fetchAll();
      unset($node_list);
      foreach ($nodes as $node) {
        $node_list[] = $node->nid;
      }

      $comments = db_select('comment', 'c')
      ->fields('c', array('cid', 'nid', 'created'))
      ->condition('c.nid', [$node_list], 'IN')
      ->execute()->fetchAll();
      foreach ($comments as $comment) {
        some actions
      }

and it's working fine. However, I believe I can make just one query for comment table by using some kind of database join to node table and check if a node belongs to $content_type. How can I do that?


texts: How to import Profile2 users with taxonomy terms using Feeds?

texts:
I need to migrate a user-database into a new drupal system that uses Profile2 user profiles. The Drupal user profile contains fields like "gender", which are Term references (field type). This reference points to a Vocabulary, in which the genders are stored. Now I have a CSV file containing all users from the old database, and a Feeds importer. The importer is setup straight forward and all "value"-fields (surname, lastname, etc.) are working, but the term reference fields are not filled. How do I setup the importer correctly?

I tried to use the gender name (male/female) and even tried the respective term-IDs (tid). The first try results in an error message (wrong input format something), the second one does not produce error outputs but leaves the term reference fields blank as well. I also tried the "Entity Field Query finder" tamper plugin, but without success.

Am I missing something? Or is this import to complex for the Feeds plugin?


texts:
I want to redirect all the users to a specific page after login. It seems like an easy thing to do using rules.

Event
User has logged in

Action
Page redirect

There is a small problem though. Page redirection will also work on the first login/password recovery scenario which in practice disallows the user to set/change his password.

Any ideas how can I deal with this issue?

I have found that the Login Destination module seems to be able to solve my problems, but I would prefer not to add more modules if it is unnecessary (I have enough things to debug now).


texts:
Trying to figure how to setup drupal 8 to function like StackExchange.

My goal is to be able to allow users to mark answers helpful so that best answers get moved to the top. Similar to StackExchange.

I can think of two ways to do this but would like some feedback from the experts.

Option 1: Create content Question and add comments to it. Use flag module to flag helpful replies. Create a template for question comments so that each top replies + its replies are groped together.

Option 2: Create Question, Create comment type Answer, Create a new comment type called replies and attach it to comment type Answer.

Or is there another alternative that I am not thinking off?

What would be the best way to create a similar setup such as StackExchange?


texts: Logins with port numbers not including ports on redirect/login

texts:
We recently upgraded our site to use Drupal 7. Previously we were using Drupal 6. In the testing phase, the Drupal 7 instance was available at ports 8000 and 8443 of the main domain, while Drupal 6 was on the defaults, i.e.:

Drupal 6: http://www.example.com
Drupal 6 secure: https://www.example.com (443)
Drupal 7: http://www.example.com:8000
Drupal 7 secure: https://www.example.com:8443

That worked fine for the testing phase; we were able to log in to each site and restrict D7 access to our internal network. Once we went live, we switched the ports, i.e.:

Drupal 6: http://www.example.com:8000
Drupal 6 secure: https://www.example.com:8443
Drupal 7: http://www.example.com
Drupal 7 secure: https://www.example.com (443)

This is working in terms of production traffic, so the new D7 site is working fine. However, when we try to log in on the old D6 site for reference, we're redirected to and logged in on the D7 site. That is, operating to https://www.example.com:8443/user and logging in results in being directed to https://www.example.com/user/foo/bar, successfully logged in. Going back to the D6 site (on 8443) shows that we are not logged in there.

I thought it could be related to the cookie domain we were using (.example.com), which seemed a stretch, but removing that didn't help. I also thought it might be a base URL problem, though we have no base URL configured. The secure pages base URLs are configured with the port numbers.

Does anyone know or have an idea as to why this is happening?

I have a feeling that it's a simple thing I've overlooked in our configuration.

HTTPS is enforced on both sites by the Secure Pages module.

EDIT: we think we narrowed it down to the login form submission. The form appears to be submitted to the main domain, without the port. That's logging us in on the wrong site and preventing us from logging in on the D6 one. Why the form would submit without the port and how to fix it is now the issue.


texts:
I have the task to query data from my phpMyAdmin database and also to query the emails from each webform 'to_email' field. Is there a way to query that data using MySql? I was able to do it using php, but I can't seem to find a way to access the webform email settings by using only MySql.
Edit: I just found out that all the website data is stocated in the database. For example, you can find the data in your 'to_email' field inside your node.type. row, in a blob.


texts: How To Hide the Contact Button and Replace with a Message

texts:
I'm building a room letting website.
Next to every advert is a send user private message button.

If the room is no longer available.
I want to replace the button with the message "Sorry room no longer available"
how can I do this please?

Many Thanks for your help
Charles


texts: Drush Bootstrap Error on Multi-Site Install

texts:
I'm getting the "needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command." error.

I know this means that Drush is not able to find the settings.php file because it is not in the Drupal root directory. I'm working with one site that is part of a multi-site install on a university server. Am I getting this error because I'm in my site's specific root as opposed to the Drupal core root?

Any help would be much appreciated, Drush seems extremely useful!

Thanks,
Kai


texts: Are shared user tables still supported and working?

texts:
I have tested a Drupal 7 multi-site before, and it worked for me perfectly. With Drupal 8, it doesn't work as expected.

Suppose there are two sites, site1  with site1_ as table prefix and site2 with site2_ as table prefix.
The documentation says that I should add the following lines in the settings.php file.

  'prefix' => array(
     'default'   => 'site2_',
     'users'     => 'shared_',
   ),

It doesn't work because the users table in Drupal 8 doesn't have username and password information.

If I add this lines, Drupal won't work normally too.

  'prefix' => array(
     'default'   => 'site2_',
     'users'     => 'site1_',
     'users_data'     => 'site1_',
     'users_field_data'     => 'site1_',
     'user__user_picture'     => 'site1_',
   ),

For example if a user in site1 changes password, this user cannot login with the new password on site2, but the user can login with the old password once, and sign out; then the new password works!

I expected that the migration path from Drupal 6 to Drupal 8 would support migration of the shared table too, but this doesn't seem to be true. Even reading https://www.drupal.org/node/2551549 and https://www.drupal.org/node/2768219 doesn't help me much.

Are shared user tables still supported and working, on Drupal 8?


texts: Drupal 6 to 7 Migration: unlimited length field using a textfield widget issue while migrating fields

texts:
I'm migrating a drupal6 site to drupal7. I had disabled all contributed moduels and ran database update which went smooth. I have enabled CCK and migrate modules, but now on the content migrate, I'm getting this for several fields - Invalid field/widget combination: The field 'field_names' in the bundle 'bundle_names' is an unlimited length field using a textfield widget, not allowed in D7. Below is snapshot of one such field:

This comment on Migrating D6 Content Construction Kit (CCK) to D7 Fields page says to give maximum lengths <= 255 before running Migrate Content. How do I do this now?


texts: How can I play an already uploaded video inside an Amazon S3 bucket? And how can I use the String Authentication on it?

texts:
I´m new with video module, and with Amazon S3.
I need a video (that I´ve already uploaded to an Amazon S3 bucket), to be able to be played inside my site. I don´t want to upload it again through Drupal.

This video needs to be private. I´ve read something about "S3 Query String Authentication" but didn´t get how to actually implement that in my site.

I´m not able to point to a video that´s already uploaded to a bucket. I can only upload through Drupal, or upload it to a folder inside my drupal installation. How can I just grab the video?

And Should I do that using string authentication? How can I avoid people that´s not logged in to see or link to the video? (I know that there´s no way to stop other people to copy your stuff, but I´ve read about hot links and would like to avoid that from happening if I can).

I need that video to be available for a long period of time for my users, I just don´t want them to post the link in other sites (and use my bandwith).

I´m pretty clueless. Please I would love some help if you can. Thanks!!!!
Rosamunda


texts: How to display an Image based on content author role in view?

texts:
I want to display an image in a view based on the role of the author of the content.
Lets say role "premium user". If the content author is not having the role just display an image placeholder ? What is the best way to do it ? Views PHP ?


texts: Search API result get view containing article, not article it self

texts:
I am having difficulties with finding view that contains searched text, not article it self. I have a page congaing 2 blocks of views, and would like to get a link to that page. Currently I get search results but link only to article.

How can I get a reference to rendered page from Search API?


texts:
I have a custom compound field working beautifully. Below is what I have defined in the hook_field_schema function:

function MODULE_field_schema(&$columns, &$indexes, &$keys) {
  $columns = array(
    'meat' => array(
      'type'        => 'int',
      'description' => 'Meat'
    ),
    'potatoes' => array(
      'type'        => 'int',
      'description' => 'Potatoes',
    ),
  );
}

Now I need to modify the schema like so:

function MODULE_field_schema(&$columns, &$indexes, &$keys) {
  $columns = array(
    'meat' => array(
      'type'        => 'int',
      'description' => 'Meat'
    ),
    'potatoes' => array(
      'type'        => 'int',
      'description' => 'Potatoes',
    ),
    'carrots' => array(
      'type'        => 'int',
      'description' => 'Carrots'
    ),
  );
}

The problem is that I am using this field on a few content types and I need a way to update those associated tables. Basically I need to know what hook I need to create to make this happen.


texts:
I have a custom module that has a JavaScript file in it. The JavaScript file is calling on the Vimeo API, which has a custom library created for it (similar to jQuery).

How can I use this library in the custom module's .js file? I've tried putting Froogaloop (the Vimeo library) inside of sites/all/libraries and then using its syntax it in the .js file within the custom module, but it's not picking the library up.


texts:
I'm looking through a Drupal 7 module code in an attempt to understand what it does. It implements hook_field_default_fields(), but I can't find any documentation on this.
What does this hook do?
I did find that the Field Types API seems to expose similar hooks such as hook_field_extra_fields(), but they aren't exactly the same.


texts: User having issue with site being redirected to home page from every link

texts:
We have a drupal 7 site hosted on a linux machine. One of our users claims they get redirected to the home page from every link they click on the site. I'm not personally having this experience with the site nor is anyone else I work with. The user hasn't given us any more information, but I'm wondering if you guys have any idea what might be going on here?

I found this thread but it seems to be mostly a Windows-based issue: Why does my drupal 7 redirect me to the home page from any link?. Plus I have clean URLs on and like I said it works fine for everyone else.

Thoughts?


texts: How to create a list of nodes that the anonymous user has created and limit it by the current session (SID)?

texts:
Is there a way to create a list of nodes that the anonymous user has created and limit it only by the user's current session?

Basically I want the anonymous user to create a node under a specific content type and give that user a list of nodes (maybe using views) that he or she created only during the his or her current session on the site.

Anybody willing to help? I've been trying this the whole day and can't seem to get it done.


texts: How to embed the draggable items into my module

texts:
Core Drupal modules have a very handy feature: draggable items:

How can I implement the same functionality in my custom module?


texts: form_set_error highlight offending field?

texts:
form_set_error supposedly takes the name of the offending form element as the first param.

I have a form element that is named "field_reviewer_terms_of_service[value]" (as taken from firebug). My code that sets the error is:

    form_set_error('field_reviewer_terms_of_service[value]', t('You must agree to the Terms of Service.'));

The error shows up in the messages, but doesn't highlight the form element itself. What am I doing wrong?

Edited with HTML of form element:

 <input type="checkbox" class="form-checkbox required error" value="1" id="edit-field-applicant-terms-of-service-value" name="field_applicant_terms_of_service[value]"> I agree to the Terms of Service


texts: How to remove the status bar from CKeditor?

texts: It seems that the module CKeditor doesn't offer in the UI the option to remove the status bar which includes the HTML path (eg: body p strong) and the re-size button.


texts:
function my_module_getcategory() {
  $nodes = node_load_multiple(db_query('SELECT nid FROM {node}')->fetchCol());
  $data = array();

  foreach ($node as $nid) {
    print $nid;
    $data[$nid] = drupal_render(node_view($nid, 'full'));
  }

  $json = drupal_json_encode($data);
}

The above code give me the following error:

  Fatal error: Call to undefined function node_load_multiple() in C:\xampp\htdocs\new_task\sites\all\modules\my_module\my_module.module on line 5

How can I fix this error? I verified the Node module is enabled.


texts:
I have created a script drup.sh to update the site with security issues and placed it in the sites/default dir.

#!/bin/bash
drush up drupal --security-only -y

And on testing it by running bash drup.sh from the command line, as the user, in the sites/default dir. all works good

When I set up a cron to run it, as the user, I get the following errors

Command pm-update needs a higher bootstrap level to run - you will       [error]
need to invoke drush from a more functional Drupal environment to run
this command.
Command pm-update needs the following modules installed/enabled to       [error]
run: update.
The drush command 'up' could not be executed.                            [error]
A Drupal installation directory could not be found                       [error]

The command I use at the moment is

bash /home/user/public_html/sites/default/drup.sh

I have looked at the page you suggested, I had looked at it before but it did not make sense to me. I have tried various combinations, without success

The closest I can get to it not giving an error is

/usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin COLUMNS=72 --username=/home/username/public_html/sites/default/drup.sh

the output is

SHELL=/bin/sh
USER=middlesex
LD_LIBRARY_PATH=
REMOTE_ADDR_PROTOCOL=4
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
SERVER_REALROOT=/usr/libexec/webmin
PWD=/usr/libexec/webmin/cron/
PERLLIB=/usr/libexec/webmin
REMOTE_ADDR=x.x.x.x
SHLVL=1
HOME=/home/username
LOGNAME=username
_=/usr/bin/env
COLUMNS=72
--username=/home/username/public_html/sites/default/drup.sh

But drush does not run or do anything


texts: How to create a chart about the number of nodes by content type?

texts:
I am trying to make a chart with 1 column for each content type. Values are the addition of each total.

I have created a view (using the Views module) with two content-type fields. One of them is configured to Count Distinct in aggregation.

In a graph, however, only one column named Type appears, and not a column for each content type.

I am trying both with Views Dataviz and Google Charts Tools.

Any help on this would be appreciated.


texts:
I migrated my database from oracle to mysql and when linking it to my drupal the following error:

Fatal error: Call to undefined function system_run_automated_cron() in /var/www/drupal/includes/common.inc on line 2732

Call Stack
#   Time    Memory  Function    Location
1   0.0000  241712  {main}( )   .../index.php:0
2   0.1117  1842704 menu_execute_active_handler( )  .../index.php:21
3   0.1120  1844088 drupal_deliver_page( )  .../menu.inc:532
4   0.1123  1845064 drupal_deliver_html_page( ) .../common.inc:2589
5   0.1213  1858496 drupal_page_footer( )   .../common.inc:2705

Someone could help me solve this problem?


texts: How to call a JavaScript function inside the form_submit?

texts:
My problem is exactly as the title of my post shows. How should I call a javascript function inside the form_submit hook?

I just need to call a function which is previously defined in a javascript file and and is added to drupal form. How should I call the function?

I have tested submit() event in Jquery. The problem with it is that it starts to be executed as soon as the submit button is pressed.

I need a strategy which can cause the execution of that javascript function INSIDE the form_submit hook, not before it.

I would appreciate if anyone can help me.


texts: WYSIWYG not appearing for custom content type

texts:
I am working on a re-work of Drupalerp (D6), as I found so many problems with it...but have run into an odd issue. As drupalerp creates it's extra content types programatically, I am unsure if it is doing it correctly. For content types created in the GUI, the Drupal way, I can get the Wysiwyg to appear.

In the node_type table the drupal nodes that work have 'node' in the module column, and has_body = 1. The erp ones have their individual module names instead of 'node'. If I switch the module to node for those ones, I get wysiwyg, but of course lose the custom programmed handling of those types.

So my question is, does that have to be 'node' in the module column of node_type in order to get wysiwyg, or is there another element missing from the programming of those custom types?


texts: Is it possible to combine two different Template.php functions?

texts:
How about two different functions like below? Is it possible to combine below two Drupal Template.php functions?

function mytheme_preprocess_node(&$vars)
function mytheme_views_pre_render(&$view)

Example:
function mytheme_preprocess_node(&$vars) {
if some field has option 1 selected
}
AND
function mytheme_views_pre_render(&$view) {
if a view is empty { attach alternative view}
}


texts: Changing field instance display settings for view_mode

texts:
Background

In the user.module file in user_build_content(), there is a line that adds fields for a given view_mode:

$account->content += field_attach_view('user', $account, $view_mode, $langcode);

The documentation for the field_attach_view() function says

  Each field is displayed according to the display options specified in the
   $instance definition for the given $view_mode.

Digging further, I find that the instance definitions are loaded/cached using FieldInfo->getBundleInstances(), which loads them from the field_config_instance table in the database in field_read_instances().

Question

I have some custom user fields already being displayed for the 'teaser' view_mode, to the exclusion of others, and I cannot find where this is coming from since no hook appears to do it in the code.

How do I change the display settings of a field for a specific view_mode? Is there a place to do this in the field UI somewhere?

Edit: I found the defaults coming from hook_field_default_field_instances(), which were exported into a module using the Features module. Can anyone tell me where I can change them in the UI in order to re-export the feature?


texts: I'd like to force users to customize URL. How to make the following field mandatory?


texts:
I had a view which has been working perfectly fine until today. All of a sudden it doesn't display anything. I took the query which displays at the bottom of the screen and put it into phpadmin and it came up as normal. What is the issue here?

EDIT:
I might have found the issue, but I am very confused. The only thing I have done recently was that I created a template file in my custom theme directory to override the node.tpl.php file (which worked fine). When I changed back to a different theme the view did display properly. I just tried deleting that new template file and clearing the cache, though, but it didn't fix the view.


texts: Relating content types to be used in Views filters

texts:
I have two content types:

Games, which have a list of Developers that worked on it.
Developers, which don't store the games they've worked on.

I need:

a view that lists Developers that you can filter by Game, but "Exposed Filters" only let me filter on fields on the Developer, so I'm not sure how to do this.
to be able to add to a list of people that worked on the Game when editing/creating, rather than have to update each Developer's list of Games they worked on.

How can I make an exposed filter which selects Developers where the Game has that Developer?