Search blog

Saturday, December 24, 2011

Error while reverting from Field Permission back to Conent Permission module (Solved)

I came across this wonderful module "field permission" which can be used for more advanced permission settings for your contents. But then after sometime I realized that I needed to implement the Question/Answer module for my client. Now, the problem I faced was the Question/Answer module depends upon the "content permission module." With the "field permission" module already implemented, I was in a fix, because once I disabled the filter permission module and re-enabled the content permission I started getting queer error while accessing my Organic Group. Something like...

"user warning: Unknown column 'node_data_field_event_date.field_event_date_value' in 'where clause' query: SELECT COUNT(*) FROM (SELECT DISTINCT node.nid AS nid FROM d6_node node LEFT JOIN d6_og_ancestry og_ancestry ON node.nid = og_ancestry.nid INNER JOIN d6_node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 966 AND na.realm = 'og_admin')"

Few weeks back, I wasn't able to find the solution to this. But today while working around, I've found it.

What I noticed is that once you enable the Filter Permission module you are asked to uninstall the content permission module. And after enabling the Filter Permission module if you create a field_type
 (in my case I'd created even_date, which as you can see in the aforementioned query was the culprit for all the errors...) and again revert back to Content Permission module you will start getting errors like mine.

To solve this, try these two simple steps:

  1. Go to "admin/content/node-settings" and REBUILD PERMISSIONS and see whether that solves your problem or not.
  2. Else go to "admin/user/permissions" and look for filed (in my case field_event_date) that's causing the error and see whether the required permission is granted to roles such as "authenticated users" and guest or the role of your choice. If, not grant the required permissions and SAVE.
Your problem should resolve now.

Wednesday, December 7, 2011

Active Slide Pager Error for Views Singleframe Slideshow Solved

This solution is for Views Slideshow: SingleFrame
6.x-2.3


I was facing this problem where I was unable to display the background for my pager-number for the activeSlide for Views Singleframe slideshow.

Finally I applied this CSS code and got it working:

.views-slideshow-controls-bottom .pager-item.activeSlide a {
    background: url("../images/custom_images/pager.png") no-repeat center bottom transparent;       
}


So, the main thing is put an "a tag" after activeSlide ==> i.e  activeSlide a.

For hover you can try this:

.views-slideshow-controls-bottom .pager-item a:hover {
    background: url("../images/custom_images/pager.png") no-repeat center bottom transparent;
}


Hope that helps.

Thursday, December 1, 2011

Ajax, JavaScript Error on Google Chrome, Drupal

Today, the whole day I noticed this queer problem in Google Chrome while using modules like Poll and Vote Up and Down. Usually with any modules that had an Ajax interaction. Like with the Vote Up Down the processing blue circle indicator wold simply keep circling and only after a page refresh it would display the votes.

I figured out, at least in my case, I had enabled the Firebug extension in Google Chrome and this was the villain. Once I disabled it all seem to be working just fine. So, here it is folks! Hope this helps..

Thursday, November 3, 2011

How to display a drupal block on a particular || specific page?

Well, I wont say this is the shortest solution, but I guess for non-programmer it just might be the simplest and yet effective solution.

It's been quite sometime that I've really coded and since the time I came across Drupal most of my time has been in learning the admin part and so haven't quite got the time to dive into Drupal development.

Anyway, I will try to explain you my trick using an analogy that I just encountered a short while ago. I was trying to configure the visibility of certain blocks related to the Organic Module. I wanted certain blocks to appear only on the Organic module and tried two solutions but they couldn't quite meet my need of the moment.

As we know in the Drupal's Page specific visibility settings we have three options, namely:

1. Show on every page except the listed pages.
2. Show on only the listed pages.
3. Show if the following PHP code returns TRUE (PHP-mode, experts only).


We are going to use the 2nd option for our solution.


Solutions #1: 

Here, selecting the "first option" I applied these settings below:

og [[refers to the main organic group page in your site ==> http://www.example.com/og ]]
og/*  [[in Drupal * is a wildcard entry, here it means, the main og page, and all the various og pages]]

The problem I encountered using this solution was that, since the group topics, are content-type, once i visited a certain group topi, the url would change to something like this ==> "www.example.com/node/12." Because of this using the solution ==> og/* was pointless.

Then again I tried this solution using a PHP snippet from this website ==> http://geshan.blogspot.com/2009/11/show-drupal-blocks-only-on-specific.html, I liked his solution but it quite didn't fulfill my requirement.

So eventually I came up with my own basic and simple solution. It's just tweaking the first solution. In the block configure page:

Select ==> "Show on only the listed pages."
and type this in the box below each statement in a new line:
og
og/*
node/12 

Note: You will have to find the node id. of your group content-type and replace 12 with it. To find the node-content type,simply edit that content-type and check the url.. there you should be able to view the node-number(id)

Top 5 Posts (Weekly)