# W każdy czwartek o 22:00 #
Spotkania ludności drupal.pl na IRC- odpal czat -
- dedykowany temat na forum -

drupal.pl w sieci Google!

Shoutbox

You're not permitted to post shouts.
DepecheMati

Widać, że pracownikom Google się nudzi - http://bit.ly/L6pAsn :-}

1 dzień 8 godzin ago
grzegorz.bartman

Wybiera się ktoś na DrupalCon do Monachium?

2 dni 9 godzin ago
malcolm

No, wspomnień czar ;)

6 dni 7 godzin ago
spamator12

@Mati thx :P
@malcolm gdzieś o tym słyszałem i to z tego forum nie pamiętam... Gra się w to jak w stare setlersy ?

6 dni 8 godzin ago

Subskrybent kanałów

Drupalpress, Drupal in the Health Sciences Library at UVA: Rule Scheduling and Emailing Views According to CCK date fields

Drupal Planet - 17 maj, 2012 - 19:24

Sometimes Drupal opens up a big can of whoop-up process on ya, and Rules Scheduler is one of those gems.  Rule Scheduler allows you to use rule triggers to schedule rule sets.

Use Case:Ever want to send an email the day before a scheduled event?  We use CCK Sign-up and wanted to send an email to users one week before an event, as well as the day of.  We also needed to send teachers views of the roster of students

Here’s the 2 minute mojo on it http://www.youtube.com/watch?v=55HwOzFHoB8 and it just highlights the mistakes I was making.

The recipe came out of Drupal documentaiton, and these two tutorials got me 90% of the way:

working with scheduled rules

And I thought I was home free, however I ran in to a pretty stupid problem that took me a minute to understand = all the identifiers need to have tokens in them with unique values or else they overwrite themselves in the database.

Solution? Easy = add some tokens – [node:nid] worked for me

The nicely scheduled rules

Another fun feature in this project was revisiting one of my favorite modules: Rules Views Integration.  The cool thing about scheduling a rendered view in a rule set is that the rule gets rendered at the last minute and so you can schedule (in our case) a class roster to go out and it’ll have the most up to date information possible at the time of sending.

NB: I also ran in to a problem where cron wasn’t sending my emails initially.  I have no idea why it was stuck, however Ultimate Cron has been a good friend of late and unlocking and running the tab got it back on track = I haven’t seen it stall in a few weeks now.

Ultimate Cron unlock and run run run

 

Something else I haven’t gotten into yet, however, is the use of the Rules Scheduler Views.   Something tells me there is some magic to be had in there, used correctly.  At this point however I’m just using the off-the-shelf defaults.   I know of no Views Bulk Operations for scheduled rules, so perhaps the default info is all there is to know.  In any case, it’s an elegant solution to working with drupal’s cron functions.

Patrick J Waters: Recent Project: Converting the BMJ (British Medical Journal) to Drupal

Drupal Planet - 17 maj, 2012 - 18:57
Recently I had the privilege of being part of a team that converted the BMJ (British Medical Journal) to Drupal. The BMJ (British Medical Journal) is one of the world’s top five international peer reviewed medical journals with more than 1.5 million unique visitors and 6.8 million page views per month.You can read the about the project and it's success at http://drupal.org/node/1557636

Pronovix: Drupal Government Days Brussels videos online

Drupal Planet - 17 maj, 2012 - 18:04
17 MayDrupal Government Days Brussels videos online

It seems like a lot is moving in Drupal for government, after Drupal got serious momentum when the White house launched their Drupal site the Drupal Government Days in Washington DC on 18 May, 2012, will be the third dedicated Drupal Government event.

Read more

Mediacurrent: "Shun" Your Clients to Serve Them Better

Drupal Planet - 17 maj, 2012 - 17:58

With something as simple as the post title, I've already broken one of the rules I'll be setting forth here—that of expectation setting. This is not a post about ignoring your clients or putting them aside or picking only the right clients and shunning the rest. This real subject of this post is the '-tion' (pronounced shun) suffix at the end of the three key thoughts: communicaTION, expectaTION and execuTION.

Phase2 Technology: Office of the New York Attorney General Finds Great Fit with OpenPublic: An Interview with New Amsterdam Ideas

Drupal Planet - 17 maj, 2012 - 16:43
When you're building a web site for a government agency, the importance of finding the right tool for the job can mean the difference between a simple web site and a true solution. For the team at New Amsterdam Ideas, OpenPublic was the right tool for the job of revamping the site of New York Attorney General Eric T. Schneiderman. I sat down with Andrew Hoppin and Sheldon Rampton from
New Amsterdam Ideas to learn more about their experience building with OpenPublic.

Clemens Tolboom: A pinch of Symfony for D8MI?

Drupal Planet - 17 maj, 2012 - 16:09

One of the goals of Drupal 8 Multilingual Inititive is to refactor Gettext file handling by a component. The first effort was Make gettext .po generation its own abstracted functionality by Gábor Hojtsy, Sutharsan, fubhy, sun and clemens.tolboom

While I (clemens.tolboom) was working on that issue I skimmed over the Translation component delivered by Symfony to see whether we could match their architecture (why reinvent components?) or even take over their components.

Progressing further and discussing progress with Gábor Hojtsy and sun on #drupal-i18nsun suggested to create a new issue trying to use the Symfony Translation component and see what happens with Let Symfony Translation component handle language messages.

This lead me into a new world of GLP versus MIT, php development, git squash, github pull requests etc.

Here are some experiences from my pull requests for Symfony (click closed button to see all.)

Experiences Licenses and the copy paste cat

My initial D8MI related pull request Drupal gettext was a bummer as I added a slightly changed and objectified copy-paste version of some parts of gettext.inc forgetting GPL does not allow loosening the license into a MIT version.

git squash et al

By having a pull request the receiving party wants a clean commit. But as a developer you commit every new feature into a local commit to make cherry-picking possible. For this to work you need to squash all commits into the commit belonging to the pull request.

Thanks to stloyd pointed me to Using Git Rebase to Squash Commits explained a great deal to me and http://symfony.com/doc/master/contributing/code/patches.html

Should we go using Symfony Translation component

The Symfony Trans2drupal pull request is developed based on the patch for Drupal Let Symfony Translation component handle language messages. That introduces a brittle dependency as it is not committed. It is not actively commented too. So that's not comforting.

The flip side is we can drop a lot of code and focus on our Drupal code when the pull request lands. In writing the code I learned new ways of coding (more PHP less Drupal) which is nice.

Image taken from http://www.mjdinteractive.com/mjd-blog/2012/04/drupal-8-to-utilize-symfo...

Drupal Watchdog: Responsive Web Design: Look Great On Any Device

Drupal Planet - 17 maj, 2012 - 00:17

It’s 2011, and the world is going mobile. People don't just use their desktop computer or laptop anymore to visit the sites you build. They're coming at you with smartphones, tablets, TV screens— and who knows what they’ll bring next year? With all this device-switching going on, one of the questions that site builders ask themselves is, how can we keep catering to all these different devices? The good news: There is a way. It’s called responsive webdesign.

In this article, we briefly lay out what responsive webdesign is, and, more importantly, how you can use it in your Drupal projects today.

What is responsive web design?

In his 2010 article on 'A List Apart', Ethan Marcotte coined the term "responsive webdesign," referring to responsive architecture. If architects can design rooms that change according to the number of people inside them, why can't web designers build web pages that adapt to the people who view them?

As you may have guessed from the name, responsive web design is all about, yes, responding to the site user's device specifics. Does the device have a wide or narrow screen? How is the user holding the device? What OS is powering the device? All these questions determine how the user experiences your website. With responsive webdesign, you can accommodate all these possible differences.

Using a combination of CSS3 media queries (which query the device's capabilities to determine the proper stylesheets to load), a flexible grid acting as the site’s foundation, and images that change according to the screen resolution, responsive webdesign allows you to work in a so called "device agnostic" way. It doesn’t matter whether the user has the latest tablet, or an early-adapter smartphone: if your design is responsive, it can adapt to the user. Think of it as a fluid (vs fixed) webdesign on heavy steroids.

Author Bruno De Bondt & Kristof Orts

Bruno De Bondt has been theming and developing Drupal sites since 2005. He is the technical lead at DeWereldMorgen.be, a popular independent news website in Belgium. He has also worked as a Drupal developer and themer for Krismon, one of the main Drupal shops in Europe. Working with them, he has built several media, non profit and advocacy websites. Bruno currently lives in Vancouver, Canada. You can reach him on Drupal.org or Twitter as brunodbo or on http://brunodbo.be.

Kristof Orts loves the web and specializes in user experience and usability. He's also a team player, for big projects he likes to work with partners that have the same knowledge and passion as he does. Some keywords Kristof uses every day: CSS3, HTML5, JS, flexible layouts, responsive and mobile design. He also loves to speak about these things at conferences.

Friendly Drupal: 15 modules to improve your Drupal administration and content management experience (D6 & D7) - part II

Drupal Planet - 16 maj, 2012 - 21:16

A continuation of the useful administration modules list started in Part I.

Devel

Used extensively by the developers, devel module can also be very helpful to the site administrators. One of its more popular features is automatic content generation (such as users and nodes) - including media files! Another nice feature is switching between users (for example, to test access permissions). It also integrates well with the admin menu module mentioned in the first part of the article.

To use Devel on Drupal 6, go to admin/generate and choose the type of items to generate (the modules comes with taxonomy, content and users, other modules add more types of content). The module can also delete the existing items (for examples, nodes by type).

Related stories: 

If you liked it this story, you might like the following:

15 modules to improve your Drupal administration and content management experience (D6 & D7) - part IRedirect 403 to User Login (r4032login module).Custom contact form with conditional fields using webform and webform conditionalDrush Site Aliases and Interactive ShellInstall Drupal 7 site with Drush

read more

Drupalize.Me: Getting Started with Calendar

Drupal Planet - 16 maj, 2012 - 15:00

In this chapter we will get a calendar up and running on our demo site. We will cover the necessary modules, how to install them, as well as basic site configurations. We'll also show how simple it is to get a calendar on your site using a views template, and then give a tour of some calendar features.

Resources  Modules Needed: 9m Publication date  May 16, 2012 - 9:00am Rules trigger for changing creation date on a scheduled publication.  No

Drupalize.Me: Calendar Series Overview

Drupal Planet - 16 maj, 2012 - 15:00

In this series we focus on building calendars with Drupal. We'll be covering topics such as basic configuration for fields and views, using calendar templates, creating blocks and different ways of displaying the calendar, along with customizing the look and feel.

This video assumes that you understand the basics of content, fields, and Views in Drupal. If you need a refresher on these topics, or want to find out more about using the Date module, here are some other tutorial series to review:

2m Publication date  May 16, 2012 - 9:00am Rules trigger for changing creation date on a scheduled publication.  No

read more

Modules Unraveled: 020 Steven Jones and The Aegir Project - Modules Unraveled Podcast

Drupal Planet - 16 maj, 2012 - 07:00

This week I talk with Steven Jones of the Aegir Project.

Here are some of the questions I asked him
  • I’ve only heard of Aegir, but never actually used it. What exactly is it?
  • How did you get started with Aegir?
  • What kinds of things can Aegir do other than site install?
  • How does Aegir integrate with Git?
  • What sort of people is Aegir appropriate for?
  • How does Aegir compare to other tools like Pantheon or Acquia’s dev cloud?
  • What about tools like Puppet or Capistrano?
  • How can people get help?
  • What’s the future of Aegir?
Questions from Twitter
  • @TimeRaider: What are the plans for 7.x release and new Drush support?
  • @tgroff: What should distributions do to ensure Aegir compatibility?
Submitted on Wed, 05/16/2012 - 00:00

Matt Farina: Drupal 7.14 API Compatibility Breaking Change

Drupal Planet - 16 maj, 2012 - 02:30

Minor Drupal versions are usually for bug fixes, security updates, and the occasional new feature that doesn't break backwards compatibility. Compatibility changes are reserved for major Drupal releases. There are exceptions such as Drupal 6.2. It was such a big deal there is an update documentation page just for this release. When Drupal 7.14 made an API breaking change without providing documentation or notification to module developers I was quite surprised. The lack of detail made it difficult to track down the changes when I had a broken codebase. Here are the details so others can, hopefully, have an easier time if they run into this problem.

Continue Reading »

Matt Grasmick: Connecting Facebook with Drupal, the easy way: Part 2

Drupal Planet - 15 maj, 2012 - 23:18

In Part 1: Connecting Facebook with Drupal, the easy way I extolled the wonders of Facebook OAuth and showed off its excellent API with an example of how to map facebook user data to Drupal user objects.

For part 2, I'm going to show you another side of the API. But before we get started, I'd like to give a quick shout-out to Nathan Haug (@quicksketch), author of Facebook OAuth. I'm about to take a lot of text directly from the Nate's well-written README.txt, so don't be confused by the liberally-applied quotation marks.

Writing custom Facebook OAuth Actions

"The Facebook OAuth module provides an API for executing queries against Facebook's vast store of user data." How does this translate into user experience (UX)? In extreme layman's terms, Facebook Oauth allows you to create custom buttons that, when clicked, will 1) grab some good facebook data, and 2) let Drupal interact with it. Sounds like fun, right?

Here are a few examples of things that you could do:

  • Create a post to facebook wall link on certain node types
  • Import a list of a user's facebook friends and expose it to Views (whoa!)
  • Import a user's facebook pictures and ... expose them to the Media module!? (that would be cool)

Hopefully you're starting to see how great this can be! Best of all, you can accomplish all of this without learning Facebook's Javascript SDK! Nate has streamlined the process of asking for facebook permissions, obtaining access tokens, etc. You just need to make a few Drupal hooks and you're off!

A simple example

To create a custom Facebook Oauth action, you'll need to drop a bit of code into a custom module. We'll start by telling Facebook Oauth that we have a new action that it should be aware of. This is done with hook_fboauth_actions().
/** * Implements hook_fboauth_actions(). */ function mymodule_fboauth_actions() { // Give each action a unique key, such as "mymodule_photo_import" for a photo // import. This function should begin with the name of your module. $actions['mymodule_photo_import'] = array( // Give you action a human-readable name. This will be used when showing // the user a link to start this action. 'title' => t('Import my Facebook photos'),   // Specify the name of your callback function that contains the import. 'callback' => 'mymodule_fboauth_action_photo_import',   // Specify permissions you need to do this action. See the Facebook API for // a list: http://developers.facebook.com/docs/authentication/permissions/ 'permissions' => array( 'user_photos', // Gets access to a user's photos. ),   // Optionally specify a file that contains your callback function. If you // put your callback function in the .module file, this is unnecessary. // 'file' => 'mymodule.inc',   // Optionally define a theme function for printing out your link (not // including the "theme_" prefix). If you use this option, you must register // this function in hook_theme(). If you don't use this option, the link // will be output with the theme_fboauth_action() function or the automatic // suggestion theme_fboauth_action__[action_name](). // 'theme' => 'mymodule_fboauth_action', ); return $actions; }

Next, you'll need to actually create the mymodule_fboauth_action_photo_import() function specified in the above hook. Until now, we've engaged in what Jeff Eaton might refer to as "Wishful Programming," meaning that we make calls to functions that we wish existed. Let's make this function a reality.
/** * Facebook OAuth action callback; Import a user's Facebook photos. */ function mymodule_fboauth_action_photo_import($app_id, $access_token) { // Query against the Facebook Graph API. See the Facebook API for a list of // commands: http://developers.facebook.com/docs/reference/api/ $result = fboauth_graph_query('me/photos', $access_token); foreach ($result['data'] as $photo) { // Do whatever you like with the photos! }   // Optionally set a completion or error message. drupal_set_message(t('Import complete!'));   // Optionally return a path to which the user will be redirected. If not set // the path in the $_REQUEST['destination'] variable will be used. If there // is no path at all specified, the user will be redirected to the homepage. return 'mymodule/import-complete'; }

"Now to get the user to actually execute this action, you need to link to Facebook so that the user can grant the necessary access. You can do this with the utility function fboauth_action_display(). Our example action was keyed as "mymodule_photo_import", so we would print the link like this:"
 print fboauth_action_display('mymodule_photo_import');

"Now when the user clicks on the output link, they will have the option of granting access to the requested information. If they approve, your callback function will be executed."

What's going on behind the scenes?

Before I go too much further, it may be good for us to go over exactly how Facebook Oauth is doing its magic. The README.txt does a great job of explaining this:

..in order to use this API it is important to understand the basic concepts of OAuth. In short, the user (and only the user) is capable of granting your site access to query information
against Facebook. The user is also only able to do this on Facebook.com, so any requests to query against Facebook must first redirect the user to Facebook where they can grant access. The full workflow looks like this:

  1. The user clicks on a link (such as the Facebook Connect button) that sends the user to Facebook. If the link is requesting permissions that the user has not yet granted, the user is prompted to allow access. After the user has granted access, or if the user granted access previously, the user is redirected back to your site.
  2. When the user is redirected back to your site, Facebook sends along an access "code". Your site then takes this access code and does a server-side request to Facebook's API servers. Facebook's servers return an access "token" to your server. This token is valid for a short amount of time and allows you to access the information to which the user granted you access.
  3. Your site can now execute queries against the user's Facebook information while the token is valid. Because this token only lasts a short amount of (about 6 hours usually), it's safest to always request access from Facebook before every data import session (by having the user click the link), which will renew the existing token or generate a new one.

Whew! Let it me said this really does happen behind the scenes. If the user has already granted the necessary permissions, they don't even see the redirect. Now let's dive back into the code.

Calling your custom actions programmatically

You may be tempted to ask, "But Matt, what if I don't want to require the user to click a button? Can I just fire my facebook action programmatically?" I'm glad you asked, because yes, you can! There's a fairly simple way to accomplish this.

// Extract the link from a given fboauth action. $fb_link = fboauth_action_link_properties('my_custom_action');   // Extract the request url from a given fboauth action link, including the query parameters. $fb_query_url = url($fb_link['href'], array('absolute' => TRUE, 'query' => $fb_link['query']));   // Redirect user to facebook for authorization. drupal_goto($fb_query_url);

When might you want to do use this method? I had two use cases for this approach:

  • Creating a menu callback that will execute an action.
  • Creating a $form['submit'][] handler that will execute an action.
Pushing data rather than pulling it

Facebook also offers a rich API for sending data back to Facebook. How can we utilize those features? It's not actually that hard. Let's take a look at how we can accomplish this by leveraging some of Facebook Oauth's built-in ability to communicate with Facebook.

The following snippet uses Facebook's Graph API to post to a user's Facebook wall.

function mymodule_fboauth_action_post_to_wall($app_id, $access_token) { // Build the data array that we'd like to post to facebook. // See https://developers.facebook.com/docs/reference/api/user/#posts for valid array keys. $query = array( 'link' => $awesome_node, 'picture' => url(drupal_get_path('theme', 'my_theme') . '/images/logo.png', array('absolute' => TRUE)), 'name' => t('@name loves Drupal', array('@name' => $user->name)), 'caption' => t('ZOMG'), 'description' => t('This message was endorsed by Grasmash'), 'app_id' => variable_get('fboauth_id', ''), );   $response = fboauth_graph_query('me/feed', $access_token, $query, 'POST'); if (isset($response->id)) { drupal_set_message(t("You have posted to your facebook wall. That must have been hard. Take a break. Have drink. You're done.")); } else { watchdog('mymodule', 'Error executing fboauth action: @error', array('@error' => (isset($reponse->error) ? $response->error : t('Something went horribly wrong')))); drupal_set_message(t("Oops! We couldn't post to your facebook wall. Try clicking harder.")); }   // Optionally redirect user. return '<front>'; }

The Encore

The possibilities don't stop there! Facebook OAuth also provides:

  • alter hooks to modify default actions
  • save and pre-save hooks for facebook registrations
  • the ability to hook into the deauthorization process

How might that help you? Well, I used these hooks to integrate Facebook OAuth with the Invite module, such that Drupal can send invites via facebook and then react to fulfilled (facebook) invitations. I'm sure you'll think of great ways to use it too.

That's all folks! I hope these quick posts have been helpful for you. If you liked the article, mention me on twitter or /msg me on IRC — madmatter23.

7.x, drupal, facebook, oauth, fb, fboauth

Mediacurrent: Webinar: A Drush Aliases Primer

Drupal Planet - 15 maj, 2012 - 21:45

A drush site alias file allows you to streamline advanced drush commands and make running them against both local and remote sites a breeze. With a properly configured alias file and an SSH key you can run frequently used commands that have complex options, with a concise easily remembered "alias" on any site. This will help you be far more productive and you will find yourself using drush itself far more often.

Acquia: File import improvements for Migrate 2.4

Drupal Planet - 15 maj, 2012 - 20:56

The Migrate module is the leading tool for migrating data from an external application into Drupal. Migrate has been used to bring many world class sites onto Drupal, including The Economist, Martha Stewart and thousands more. The main theme of the upcoming Migrate 2.4 release is improved file handling on Drupal 7.

Commerce Guys: Commerce Module Tuesday: Commerce AutoSKU

Drupal Planet - 15 maj, 2012 - 20:16

Commerce AutoSKU is a really useful tool for those Drupal Commerce users that don't need or don't care about generating their own SKU identifiers. This module uses the Drupal core capabilities to manage tokens and generate SKU for the products based in other product properties such as title, product id or any other token available in the product context. Additionally, the contributed Token module helps a lot with the selection of the pattern.

The automatic SKU generation can be configured at the product type level and the SKU field can be hide to the administrator users, it also supports case transformation and other settings.

Tags: Drupal 7Commerce Module TuesdayPlanet Drupal var switchTo5x=true;stLight.options({publisher:'dr-2277fa04-9203-1dc3-ced9-ffc8e5c4d194'});

Phase2 Technology: Creating handlers for Video Embed Field

Drupal Planet - 15 maj, 2012 - 19:32
Video Embed Field is a module that provides a simple interface for placing videos on your Drupal site. It works by simply providing a field of type 'Video Embed' which allows a user to paste in the link to a video from Youtube or Vimeo. The module then provides formatters to show the video and specify settings for it (for example: autoplay, width and height of player, skin color) or as a thumbnail. My hope with the module is to make videos really simple to add to any Drupal site, without a lot of configuration or headache. This blog post is a walkthrough of how to create handlers for other video services that you wish to support.

Midwestern Mac, LLC: Filter/Search on multiple fields with Views 3.x

Drupal Planet - 15 maj, 2012 - 17:13

A common need I run into with a ton of Drupal sites and Views is searching/filtering content based on multiple fields. For example, a lot of people would like to search for content using either the Title or the Body for a particular content type.

There are two primary solutions offered for this situation, but they both have downsides or are overly complex, in my opinion:

  • Use the Computed Field module to create yet another field stored in the database, combining the two (or more) fields you want to search, then expose a filter for that field instead of both of the individual fields. (I don't like this because it duplicates content/storage, and involves an extra module to do so).
  • Use the Views Filters Populate to invisibly populate a second field that you've added to a views OR group (using Views OR in Views 2.x, or the built-in AND/OR functionality in Views 3.x). (This module is slightly limited in that you can only work with strings, and again, it involves an extra module).

Instead of using an extra module, I simply do the following to achieve a multi-field search:

Acquia: Measuring Community Participation in Open Source Projects: Data from Drupal.org

Drupal Planet - 15 maj, 2012 - 16:57
Measuring Community Participation in Open Source Projects: Data from Drupal.org

A defining aspect of open source software such as Drupal is the collaboration among multiple individuals and organizations on the same software.

So how do you measure the activity of contributors who are working on that software?

For Drupal-based projects, the issue queue and project usage statistics are two good sources of data for measuring participation.

Morten.dk: the second rate citizens of drupalcon

Drupal Planet - 14 maj, 2012 - 22:27

Today the Drupal association presented a new initiative for getting more students & grow the talent pool for the Drupal Project. This is done by setting x number the tickets for Drupalcon munich to half price of the 400€ - well that is if you're a student. This raises big problems about the future the event I see as the Heart & Soul of the Drupal Community.

read more