Drupal Planet

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 11 hours 33 min ago

.VDMi/Blog: I went to Drupal 7.33 and all I got was a slow site

Thu, 11/27/2014 - 3:29pm
div class=field field-name-field-afbeelding field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evena href=/blog/i-went-drupal-733-and-all-i-got-was-slow-siteimg style=max-width: 40%; height: auto; float: left; margin-right: 1em; align=left hspace=10 src=http://www.vdmi.nl/sites/vdmisite.s1.aegirhost.nl/files/styles/200_max_width/public/sad_drupal_icon_0.jpg?itok=i-FMq2_0 width=110 height=110 alt=I went to Drupal 7.33 and all I got was a slow site //a/div/div/divdiv class=field field-name-field-samenvatting1 field-type-text-long field-label-hiddendiv class=field-itemsdiv class=field-item evenSo, you just upgraded your site(s) to Drupal gt;= 7.33, everything seemed fine in your tests. You deployed the new release and after a while you notice that your site isn#039;t as fast as before. It#039;s actually slowing down everything on your server. You started Googling and ended up on this blogpost. Sounds like your story? Read on!/div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpI spent the last 2 hours figuring this out, I decided it would be best to write it up right away while it's fresh in my memory. TLDR; at the bottom of this post./p pWe did an upgrade to Drupal 7.34 recently, we thought everything was fine. Release went over 3 different environments before deploying to live and no actual issues were found./p pAfter deployment to live, we got some reports that the site was responding slow. We didn't directly link it to the upgrade to 7.34, I actually did a diff between 7.32 and 7.34 to see what changed after these reports and did not see anything suspicious that could cause this./p pWe had to investigate after a while as there was no sign of improvement, the CPU of the server was hitting 100% 24/7. New Relic monitoring told us about many calls to the file_scan_directory function of Drupal. When I actually logged the calls with the following snippet:/p p/pprecodestatic $count;br / if (!isset($count)) {br /   $count = 0;br / }br / $count++;br / drupal_debug($count . PHP_EOL);/code/pre pThe count actually went up to 700 for every request (It's quite a large project, plus the file_scan_directory is recursive).br /When I printed the debug_backtrace, I saw that this call was coming from drupal_get_filename.br /Looking at the function arguments, Drupal was looking for a imagecache_actions file, why?! And why on every request? Doesn't it cache these records in the registry?!/p pYes it does! It appeared the imagecache_actions module had a typo in it (patch a href=https://www.drupal.org/node/2166715here/a):br //p precodemodule_load_include('inc', 'imagcache_actions', 'image_overlay.inc');/code/pre pThis should be:br //p precodemodule_load_include('inc', 'imagecache_actions', 'image_overlay.inc');/code/pre pThis would not have been an issue previously, 7.33 introduced a a href=https://www.drupal.org/node/2228825change/a though.br /Pre 7.33:br //p precode$file = db_query(SELECT filename FROM {system} WHERE name = :name AND type = :type, array(':name' =gt; $name, ':type' =gt; $type))-gt;fetchField();br / if (file_exists(DRUPAL_ROOT . '/' . $file)) {br /   $files[$type][$name] = $file;br / }/code/pre p7.33 or higher:br //p precode$file = db_query(SELECT filename FROM {system} WHERE name = :name AND type = :type, array(':name' =gt; $name, ':type' =gt; $type))-gt;fetchField();br / if ($file !== FALSE amp;amp; file_exists(DRUPAL_ROOT . '/' . $file)) {br /   $files[$type][$name] = $file;br / }/code/pre pBefore 7.33, Drupal would try to find the record in the system table, it wouldn't find it and the $file would be NULL. The resulting string would be DRUPAL_ROOT . '/' . $file, as $file is NULL, you can also see it as DRUPAL_ROOT . '/'. Obviously the DRUPAL_ROOT exists, so it returns TRUE. It would put the record in the $files array and continue with what it was doing./p pBecause 7.33 and higher does a NULL-check on $file, it will not add any record to the $files array. This causes it to go into the file discovery routine:br //p precodeif (!isset($files[$type][$name])) {br /   // ... Some codebr /   $matches = drupal_system_listing(/^ . DRUPAL_PHP_FUNCTION_PATTERN . \.$extension$/, $dir, 'name', 0);br /   foreach ($matches as $matched_name =gt; $file) {br /     $files[$type][$matched_name] = $file-gt;uri;br /   }br / }/code/pre pThis code will try to scan your Drupal installation for the given file. It will not find the file and continue eventually, but it will execute the file search in EVERY request that you execute the module_load_include./p pWhile our issue was in the imagecache_actions module, your issue might be in any module (even custom) which does a wrong module_load_include.br /It's very hard to find this out yourself. You can edit includes/bootstrap.inc on line 866 to write some info away to /tmp/drupal_debug.txt:br /Add the following code after line 866:br //p precodeelse {br /   drupal_debug('Missing file ' . $type . ' ' . $name . ' ' . DRUPAL_ROOT . '/' . $file . PHP_EOL);br / }/code/pre pTLDR; an issue in imagecache_actions combined with an upgrade to Drupal gt;= 7.33 killed the performance of our site. Patch for imagecache_actions a href=https://www.drupal.org/node/2166715here/a. Causing issue/patch a href=https://www.drupal.org/node/2228825here/a./p /div/div/div
Categories: Drupal Feeds

Blair Wadman: Eleven tips to keep Drupal up to date with security releases

Thu, 11/27/2014 - 2:36pm
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpKeeping your Drupal site up to date has always been of critical importance to ensure it remains secure. Last month's announcement of a a href=https://www.drupal.org/SA-CORE-2014-005SQL Injection vulnerability/a and subsequent announcement of a href=https://www.drupal.org/PSA-2014-003automated attacks within 7 hours/a caused wide spread panic across much of the Drupal community./p/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/drupal/all typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal/a/divdiv class=field-item odd rel=dc:subjecta href=/drupal/planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Planet Drupal/a/div/div/div
Categories: Drupal Feeds

Appnovation Technologies: Searching and attaching images to content

Thu, 11/27/2014 - 11:00am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpBecause of its ability to extend the core platform, Drupal has become a popular CMS/Framework for many large media and publishing companies./p/div/div/divdiv class=field field-name-field-blog-header-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evena href=/blog/searching-and-attaching-images-contentimg typeof=foaf:Image src=http://www.appnovation.com/sites/default/files/styles/blog_listing_page_header/public/searchingimages.jpg?itok=zi27xJcn width=680 height=200 alt= //a/div/div/divdiv class=sharethis-buttonsdiv class=sharethis-wrapperspan st_url=http://www.appnovation.com/blog/searching-and-attaching-images-content st_title=Searching and attaching images to content class=st_facebook/span span st_url=http://www.appnovation.com/blog/searching-and-attaching-images-content st_title=Searching and attaching images to content class=st_twitter/span span st_url=http://www.appnovation.com/blog/searching-and-attaching-images-content st_title=Searching and attaching images to content class=st_sharethis/span script type='text/javascript'var switchTo5x = false;/scriptscript type='text/javascript' src='http://w.sharethis.com/button/buttons.js'/scriptscript type='text/javascript'stLight.options({publisher:dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683});/script/div/div
Categories: Drupal Feeds

Oliver Davies: Include environment-specific settings files on Pantheon

Thu, 11/27/2014 - 10:24am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpI was recently doing some work on a site hosted on a href=http://getpantheon.comPantheon/a and came across an issue, for which part of the suggested fix was to ensure that the code$base_url/code variable was explicitly defined within settings.php (this is also best practice on all Drupal sites)./p pThe way that was recommended was by using a codeswitch()/code function based on Pantheon's environment variable. For example:/p/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfixh3 class=field-labelTags: /h3ul class=linksli class=taxonomy-term-reference-0a href=/blog/tags/drupal-planetDrupal Planet/a/lili class=taxonomy-term-reference-1a href=/blog/tags/pantheonPantheon/a/lili class=taxonomy-term-reference-2a href=/blog/tags/settingsphpsettings.php/a/lili class=taxonomy-term-reference-3a href=/blog/tags/drupalDrupal/a/li/ul/div
Categories: Drupal Feeds

Cheppers blog: Acquia Certified Developer exam - passed!

Thu, 11/27/2014 - 6:21am
div class=field field-name-field-front-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item even rel=schema:image resource=http://cheppers.com/sites/default/files/styles/blog_promoted-image/public/blog_2.jpg?itok=cmTCmpL6a href=/blog/acquia-certified-developer-exam-passedimg typeof=foaf:Image src=http://cheppers.com/sites/default/files/styles/blog_promoted-image/public/blog_2.jpg?itok=cmTCmpL6 width=350 height=210 alt= //a/div/div/divdiv class=field field-name-field-lead field-type-text-long field-label-hiddendiv class=field-itemsdiv class=field-item even property=schema:headlinepWe are proud to announce that Cheppers has now three Acquia Certified Developers!br / This Monday Mau, Attila and Andor have all passed the exam held by Acquia, and we are very proud of them./p /div/div/divspan rel=schema:url resource=/blog/acquia-certified-developer-exam-passed class=rdf-meta/spanspan property=schema:name content=Acquia Certified Developer exam - passed! class=rdf-meta/span
Categories: Drupal Feeds

Kristian Polso: Crawling the top 15,000 Drupal websites

Thu, 11/27/2014 - 4:01am
So I crawled the top 1,000,000 websites from Alexa, looking for all of the Drupal websites (and other popular CMS's). Here are the results.
Categories: Drupal Feeds

Joachim's blog: A git-based patch workflow for drupal.org (with interdiffs for free!)

Thu, 11/27/2014 - 2:39am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpThere's been a lot of discussion about how we need github-like features on d.org. Will we get them? There's definitely many improvements in the pipeline to the way our issue queues work. Whether we actually need to replicate github is another debate (and my take on it is that I don't think we do)./p pIn the meantime, I think that it's possible to have a good collaborative workflow with what we have right now on drupal.org, with just the issue queue and patches, and git local branches. Here's what I've gradually refined over the years. It's fast, it helps you keep track of things, and it makes the most of git's strengths./p h2A word on local branches/h2 pGit's killer feature, in my opinion, is local branches. Local branches allow you to keep work on different issues separate, and they allow you to experiment and backtrack. To get the most out of git, you should be making small, frequent commits./p pWhenever I do a presentation on git, I ask for a show of hands of who's ever had to bounce on CMD-Z in their text editor because they broke something that was working five minutes ago. Commit often, and never have that problem again: my rule of thumb is to commit any time that your work has reached a state where if subsequent changes broke it, you'd be dismayed to lose it./p h2Starting work on an issue/h2 pMy first step when I'm working on an issue is obviously:/p pdiv class=codeblockcodenbsp; git pull/code/div/p pThis gets the current branch (e.g. 7.x, 7.x-2.x) up to date. Then it's a good idea to reload your site and check it's all okay. If you've not worked on core or the contrib project in question in a while, then you might need to run update.php, in case new commits have added updates./p pNow start a new local branch for the issue:/p pdiv class=codeblockcodenbsp; git checkout -b 123456-foobar-is-broken/code/div/p pI like to prefix my branch name with the issue number, so I can always find the issue for a branch, and find my work in progress for an issue. A description after that is nice, and as git has bash autocompletion for branch names, it doesn't get in the way. Using the issue number also means that it's easy to see later on which branches I can delete to unclutter my local git checkout: if the issue has been fixed, the branch can be deleted!/p pSo now I can go ahead and start making commits. Because a local branch is private to me, I can feel free to commit code that's a total mess. So something like:/p pdiv class=codeblockcodenbsp; dpm($some_variable_I_needed_to_examine);br /nbsp; /*br /nbsp; // Commented-out earlier approach that didn't quite work right.br /nbsp; $foo += $bar;br /nbsp; */br /nbsp; // Badly-formatted code that will need to be cleaned up.br /nbsp; if($badly-formatted_code) { $arg++; }/code/div/p pThat last bit illustrates an important point: commit code before cleaning up. I've lost count of the number of times that I've got it working, and cleaned up, and then broken it because I've accidentally removed an important that was lost among the cruft. So as soon as code is working, I make a commit, usually whose message is something like 'TOUCH NOTHING IT WORKS!'. Then, start cleaning up: remove the commented-out bits, the false starts, the stray code that doesn't do anything. (This is where you find it actually does, and breaks everything: but that doesn't matter, because you can just revert to a previous commit, or even use git bisect.)/p h2Keeping up to date/h2 pCore (or the module you're working on) doesn't stay still. By the time you're ready to make a patch, it's likely that there'll be new commits on the main development branch (with core it's almost certain). And prior to that, there may be commits that affect your work in some way: API changes, bug fixes that you no longer need to work around, and so on./p pOnce you've made sure there's no work currently uncommitted (either use git stash, or just commit it!), do:/p pdiv class=codeblockcodegit fetchbr /git rebase BRANCH/code/div/p pwhere BRANCH is the main development branch that is being committed to on drupal.org, such as 8.0.x, 7.x-2.x-dev, and so on./p p(This is arguably one case where a local branch is easier to work with than a github-style forked repository.)/p pThere's lots to read about rebasing elsewhere on the web, and some will say that rebasing is a terrible thing. It's not, when used correctly. It can cause merge conflicts, it's true. But here's another place where small, regular commits help you: small commits mean small conflicts, that shouldn't be too hard to resolve./p h2Making a patch/h2 pAt some point, I'll have code I'm happy with (and I'll have made a bunch of commits whose log messages are 'clean-up' and 'formatting'), and I want to make a patch to post to the issue:/p pdiv class=codeblockcodenbsp; git diff 7.x-1.x gt; 123456.PROJECT.foobar-is-broken.patch/code/div/p pAgain, I use the issue number in the name of the patch. Tastes differ on this. I like the issue number to come first. This means it's easy to use autocomplete, and all patches are grouped together in my file manager and the sidebar of my text editor./p h2Reviewing and improving on a patch/h2 pNow support Alice comes along, reviews my patch, and wants to improve it. She should make her own local branch:/p pdiv class=codeblockcodenbsp; git checkout -b 123456-foobar-is-broken/code/div/p pand download and apply my patch:/p pdiv class=codeblockcodenbsp; wget PATCHURLbr /nbsp; patch -p1 lt; 123456.PROJECT.foobar-is-broken.patch/code/div/p p(Though I would hope she has a bash alias for 'patch -p1' like I do. The other thing to say about the above is that while wget is working at downloading the patch, there's usually enough time to double-click the name of the patch in its progress output and copy it to the clipboard so you don't have to type it at all.)/p pAnd finally commit it to her branch. I would suggest she uses a commit message that describes it thus:/p pdiv class=codeblockcodenbsp; git commit -m joachim's patch at comment #1/code/div/p p(Though again, I would hope she uses a GUI for git, as it makes this sort of thing much easier.)/p pAlice can now make further commits in her local branch, and when she's happy with her work, make a patch the same way I did. She can also make an interdiff very easily, by doing a git diff against the commit that represents my patch./p h2Incorporating other people's changes to ongoing work/h2 pAll simple so far. But now suppose I want to fix something else (patches can often bounce around like this, as it's great to have someone else to spot your mistakes and to take turns with). My branch looks like it did at my patch. Alice's patch is against the main branch (for the purposes of this example, 7.x-1.x)./p pWhat I want is a new commit on the tip of my local branch that says 'Alice's changes from comment #2'. What I need is for git to believe it's on my local branch, but for the project files to look like the 7.x-1.x branch. With git, there's nearly always a way:/p pdiv class=codeblockcodenbsp; git checkout 7.x-1.x ./code/div/p pNote the dot at the end. This is the filename parameter to the checkout command, which tells git that rather than switch branches, you want to checkout just the given file(s) while staying on your current branch. And that the filename is a dot means we're doing that for the entire project. The branch remains unchanged, but all the files from 7.x-1.x are checked out./p pI can now apply Alice's patch:/p pdiv class=codeblockcodenbsp; wget PATCHURLbr /nbsp; patch -p1 lt; 123456.2.PROJECT.foobar-is-broken.patch/code/div/p p(Alice has put the comment ID after the issue ID in the patch filename.)/p pWhen I make a commit, the new commit goes on the tip of my local branch. The commit diff won't look like Alice's patch: it'll look like the difference between my patch and Alice's patch: effectively, an interdiff./p pdiv class=codeblockcodenbsp; git commit -m Alice's patch at comment #2/code/div/p pI can now do a diff as before, post a patch, and work on the issue advances to another iteration./p pHere's an example of my local branch for an issue on Migrate I've been working on recently. You can see where I made a bunch of commits to clean up the documentation to get ready to make a patch. Following that is a commit for the patch the module maintainer posted in response to mine. And following that are a few further tweaks that I made on top of the maintainer's patch, which I then of course posted as another patch./p pimg src=http://www.noreiko.com/sites/default/files/article/image/git-local-branch-issue-workflow.png width=457 height=257 alt=A screenshot of a git GUI showing the tip of a local branch, with a commit for a patch from another user. //p h2Improving on our tools/h2 pWhere next? I'm pretty happy with this workflow as it stands, though I think there's plenty of scope for making it easier with some git or bash aliases. In particular, applying Alice's patch is a little tricky. (Though the stumbling block there is that you need to know the name of the main development branch. Maybe pass the script the comment URL, and let it ask d.org what the branch of that issue is?)/p pBeyond that, I wonder if any changes can be made to the way git works on d.org. A sandbox per issue would replace the passing around of patch files: you'd still have your local branch, and merge in and push instead of posting a patch. But would we have one single branch for the issue's development, which then runs the risk of commit clashes, or start a new branch each time someone wants to share something, which adds complexity to merging? And finally, sandboxes with public branches mean that rebasing against the main project's development can't be done (or at least, not without everyone know how to handle the consequences). The alternative would be merging in, which isn't perfect either./p pThe key thing, for me, is to preserve (and improve) the way that so often on d.org, issues are not worked on by just one person. They're a ball that we take turns pushing forward (snowball, Sisyphean rock, take your pick depending on the issue!). That's our real strength as a community, and whatever changes we make to our toolset have to be made with the goal of supporting that./p /div/div/divul class=links inlineli class=comment-add first lasta href=/comment/reply/33#comment-form title=Share your thoughts and opinions related to this posting.Add new comment/a/li /ul
Categories: Drupal Feeds

PreviousNext: Lightning talk - Drupal 8's Third Party Settings Interface

Wed, 11/26/2014 - 8:22pm
pDuring this weeks developers' meeting our lightning talk was all about Drupal 8's ThirdPartySettingsInterface./p pHere's the video introduction to this powerful new feature in Drupal./p span property=dc:title content=Lightning talk - Drupal 8#039;s Third Party Settings Interface class=rdf-meta element-hidden/span
Categories: Drupal Feeds

Acquia: Part 2 – Cal Evans and Jeffrey A. jam McGuire talk open source

Wed, 11/26/2014 - 5:53pm
div class=form-item form-type-item labelLanguage /label Undefined /div div class=field field-name-body field-type-text-with-summary field-label-hidden div class=field-items div property=content:encoded class=field-item evenpstrongVoices of the ElePHPant / Acquia Podcast Ultimate Cage Match Part 2/strong - I had the chance to try to pull Cal Evans out of his shell at DrupalCon Amsterdam. After a few hours, he managed to open up and we talked about a range of topics we have in common. In this part of our conversation we talk about 'Getting off the Island', inter-project cooperation in PHP and Drupal's role in that; the reinvention and professionalization of PHP core development; decoupled, headless Drupal 8; PHP and the LAMP stack as tools of empowerment and the technologists' responsibility to make devices and applications that are safe, secure, and private by default./p /div /div /div span property=dc:title content=Part 2 – Cal Evans and Jeffrey A. quot;jamquot; McGuire talk open source class=rdf-meta element-hidden/span
Categories: Drupal Feeds

Four Kitchens: Extracting data from Drupal entities the right way

Wed, 11/26/2014 - 12:54pm
div class=field-body pIf you#8217;ve ever had to extract data from Drupal entities you know it can be a painful process. This post presents a solution for distilling Drupal entities into human-readable documents that can be easily consumed by other modules andnbsp;services./p /div div class=field-blog-categories-term-tree a href=/topics/projects typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Projects/a /div div class=field-blog-categories-term-tree a href=/topics/drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal/a /div
Categories: Drupal Feeds

Drupal 8 Rules: #d8rules update October-November 2014

Wed, 11/26/2014 - 11:28am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpCurious why the Rules module still isn't finished, even when our a href=/node/27initial milestone planning/a aimed to ship Rules 8.x by 2014? The bad news is we are a bit delayed, but that pretty much aligns with the state of Drupal 8 core. And we are working hard on solving problems in a generic way for entire Drupal core instead of having to fork APIs in Rules./p h2DrupalCon Amsterdam Recap/h2 pimg alt=#d8rules BoF @ DrupalCon Amsterdam title=#d8rules BoF @ DrupalCon Amsterdam height=160 width=240 class=panopoly-image-quarter media-element file-teaser panopoly-image-quarter src=http://d8rules.org/files/styles/panopoly_image_quarter/public/DSCF6588.JPG?itok=h7eT8jV6 //p pWe were quite active at DrupalCon Amsterdam: I gave a 12 minutes update on the #d8rules initiative (a href=https://amsterdam2014.drupal.org/session/drupal-8-contrib-module-updatevideo/a amp; a href=https://docs.google.com/presentation/d/1b2_LuGr7-MgO9Ni6CX4SBv4e73ejjTVOnCulfnRBDZc/edit#slide=id.g3b2135a07_00slides/a) and we had some productive discussions on crowd funding in general at the community summit (a href=https://docs.google.com/document/d/1DO6Cra1GcW45lP5Chwsp21fYE5rVgGHZzkhiGrtmUMs/editnotes/a amp; a href=https://amsterdam2014.drupal.org/session/funding-drupal-corerelated core conversation/a)./p pOn Thursday, we had a BoF to get contributors up to speed with development for Rules in Drupal 8 and on Friday we sprinted the whole day to port actions and get Milestone 1 finished./p h2Development status /h2 pAs a href=https://www.drupal.org/node/2245015[META] Rules 8.x Roadmap/a states, most of the funded Milestone 1 tasks have been finished but a number of core integration tasks are still in progress. The a href=https://www.drupal.org/node/2011038unified context/a system is going to be used across Blocks, Conditions and Actions API as well as related contrib modules like the Drupal 8 version of a href=https://www.drupal.org/project/page_managerPage Manager/a. In Drupal 7 CTools and Rules together with the Entity module basically invented two separate context systems, so compared to that this is a big step fowards and will bring site builders and developers a much better plugin interopability amp; re-usability in Drupal 8./p pSome core tasks we are currently working on are:/p ul lia href=https://www.drupal.org/node/2349991Provide a trait for categorizing plugin managers and use it for conditions and actions/a/li lia href=https://www.drupal.org/node/2011038Use Context system for actions/a/li lia href=https://www.drupal.org/node/2329937Allow definition objects to provide options/a/li /ul pIn Rules 8.x-3.x, we recently finisihed the conversion of all condition and action test cases to PHPUnit based integration tests, what helps to test the plugins including their annotation and runs very fast (without a full bootstrap). During the sprints in Amsterdam we worked with contributors on porting more of Rules' actions to the new Action API, including test coverage. We'll continue to work on porting actions with contributors via the issue queue and run sprints on the coming events we attend./p h2Next steps amp; events/h2 pimg alt=dasjo presenting on #d8rules title=dasjo presenting on #d8rules height=360 width=240 class=panopoly-image-quarter media-element file-teaser panopoly-image-quarter src=http://d8rules.org/files/styles/panopoly_image_quarter/public/15397950091_f3a035cbd8_z.jpg?itok=gnc_Ng6N //p pWe anticipate to use the budget raised by the end of 2014. Next year, we will have to look for further funding resources or limit work on Rules 8.x to our free time. Thanks again to a href=http://d8rules.org/supporterseveryone supporting us so far/a!/p pThere are already some great Drupal events lined up for next year where the #d8rules initiative will be present:/p pstrongDrupalCon Bogota, 10-12 of February 2014/strong will feature a full session on upgrading modules to integrate with Rules in Drupal 8 by dasjo: a href=https://latinamerica2015.drupal.org/session/d8rules-web-automation-rules-drupal-8#d8rules - Web-automation with Rules in Drupal/a/p pstrongEuropean Drupal Days Milano, 19-21 of March 2015/strong  will include a a href=http://milano2015.drupaldays.it/programsession, training workshop amp; sprints/a provided by fago amp; dasjo./p pa href=http://d8rules.org/supportLet us know/a if you want to get involved at any of these events and see you the core amp; Rules issue queues!/p pdasjo on behalf of the a href=http://d8rules.org/team#d8rules team/a /p /div/div/div
Categories: Drupal Feeds

Code Karate: Drupal 7 File Resumable Upload Module

Wed, 11/26/2014 - 9:04am
div class=field field-name-field-episode-number field-type-number-integer field-label-abovediv class=field-labelEpisode Number:nbsp;/divdiv class=field-itemsdiv class=field-item even181/div/div/divdiv class=field field-name-field-ddod-video field-type-file field-label-hiddendiv class=field-itemsdiv class=field-item evenimg src=http://codekarate.com/sites/default/files/styles/large/public/media-youtube/dj-CH5vYne4.jpg?itok=wfzXERbc alt=Drupal 7 File Resumable Upload Module - Daily Dose of Drupal episode 181 //div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpThe Drupal 7 a href=https://www.drupal.org/project/file_resup rel=nofollowFile Resumable Upload Module/a is a great way to allow your Drupal site to upload large files. This is especially helpful if your server limits the size of files you can upload to your Drupal site. The module simply replaces the standard Drupal file upload field with a better alternative that allows:/p/div/div/divdiv class=field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/category/tags/drupalDrupal/a/divdiv class=field-item odda href=/category/tags/drupal/drupal-7Drupal 7/a/divdiv class=field-item evena href=/category/tags/drupal/file-managementFile Management/a/divdiv class=field-item odda href=/category/tags/drupal/mediaMedia/a/divdiv class=field-item evena href=/category/tags/drupal-planetDrupal Planet/a/div/div/div
Categories: Drupal Feeds

Paul Booker: Programmatically adding terms into a vocabulary from a structured text file

Wed, 11/26/2014 - 4:06am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpre class=brush: php /** * Implements hook_install(). */ function artist_install() { artist_install_vocabularies(); artist_install_terms(); } /** * Installs artist module's default terms that are read from * text files in the module's includes folder. */ function artist_install_terms() { foreach (array_keys(artist_vocabularies()) as $machine_name) { $v = taxonomy_vocabulary_machine_name_load($machine_name); $wrapper = entity_metadata_wrapper('taxonomy_vocabulary', $v); if ($wrapper-term_count-value() == 0) { $path = drupal_get_path('module', 'artist') . '/includes/terms_' . $v-machine_name . '.txt'; $lines = file($path, FILE_SKIP_EMPTY_LINES); artist_install_term_tree($wrapper, $lines); } } } /** * Installs a term tree. * @param $vwrapper * EntityMetadataWrapper of a taxonomy_vocabulary entity. * @param $lines * Array of lines from the term text file. The iterator must be set * to the line to parse. * @param $last * Either NULL or the parent term ID. * @param $depth * Current depth of the tree. */ function artist_install_term_tree($vwrapper, $lines, $last = NULL, $depth = 0) { $wrapper = NULL; while ($line = current($lines)) { $name = trim($line); $line_depth = max(strlen($line) - strlen($name) - 1, 0); if ($line_depth $depth) { return; } else if ($line_depth $depth) { $tid = $wrapper ? $wrapper-tid-value() : NULL; artist_install_term_tree($vwrapper, $lines, $tid, $depth+1); } else { $data = array( 'name' = $name, 'vid' = $vwrapper-vid-value(), 'parent' = array($last ? $last : 0), ); $term = entity_create('taxonomy_term', $data); $wrapper = entity_metadata_wrapper('taxonomy_term', $term); $wrapper-save(); next($lines); } } } /** * Installs terms into default vocabularies. */ function artist_update_7201($sandbox) { artist_install_terms(); } /prep In the preceding code, term names are read from text files that have tab indentation to symbolize the term hierarchy/p /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfixh3 class=field-labelTags: /h3ul class=linksli class=taxonomy-term-reference-0a href=/drupal-developer/tags/taxonomy typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=taxonomy/a/lili class=taxonomy-term-reference-1a href=/drupal-developer/tags/term typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=term/a/lili class=taxonomy-term-reference-2a href=/drupal-developer/tags/entity typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=entity/a/lili class=taxonomy-term-reference-3a href=/drupal-developer/tags/entitycreate typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=entity_create/a/lili class=taxonomy-term-reference-4a href=/drupal-developer/tags/entitymetadatawrapper typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=entity_metadata_wrapper/a/lili class=taxonomy-term-reference-5a href=/drupal-developer/tags/drupalplanet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=drupalplanet/a/li/ul/divdiv class=easy_social_box clearfix horizontal easy_social_lang_und div class=easy_social-widget easy_social-widget-twitter firsta href=http://twitter.com/share class=twitter-share-button data-url=http://www.paulbooker.co.uk/drupal-developer/code-snippet/programmatically-adding-terms-vocabulary-structured-text-file-0 data-count=horizontal data-lang = en data-via= data-related=:Check it out! data-text=Programmatically adding terms into a vocabulary from a structured text fileTweet/a/div div class=easy_social-widget easy_social-widget-facebookiframe src=//www.facebook.com/plugins/like.php?locale=en_USamp;href=http%3A//www.paulbooker.co.uk/drupal-developer/code-snippet/programmatically-adding-terms-vocabulary-structured-text-file-0amp;send=falseamp;layout=button_countamp;width=88amp;show_faces=trueamp;action=likeamp;colorscheme=lightamp;font=amp;height=21amp;appId= scrolling=no frameborder=0 style=border:none; overflow:hidden; width:88px; height:21px; allowTransparency=true/iframe/div div class=easy_social-widget easy_social-widget-googleplusdiv class=g-plusone data-size=medium data-annotation=bubble data-href=http://www.paulbooker.co.uk/drupal-developer/code-snippet/programmatically-adding-terms-vocabulary-structured-text-file-0/div/div div class=easy_social-widget easy_social-widget-linkedin lastscript type=in/share data-url=http://www.paulbooker.co.uk/drupal-developer/code-snippet/programmatically-adding-terms-vocabulary-structured-text-file-0 data-counter=right/script/div /div !-- /.easy_social_box --
Categories: Drupal Feeds

Drupal Association News: Drupal Association Board Meeting: 21 November 2014

Tue, 11/25/2014 - 10:27pm
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpimg alt= src=https://assoc.drupal.org/files/15232316799_7b49fae522_m.jpg style=width: 240px; height: 240px; border-width: 0px; border-style: solid; margin: 5px; float: left; /It is hard to believe, but we just finished our second-to-last board meeting of the year. The Association has grown and changed so much in 2014 and the November meeting was a great chance to talk about some of those changes and what we are planning for 2015. It was a somewhat short public meeting as we spent the bulk of our time in Executive Session to review the financial statements from the last quarter and the staff's proposed 2015 Leadership Plan and Budget. As always, you can review the a href=https://docs.google.com/a/association.drupal.org/document/d/1Grxst12boFKxO_qSyMxmDAPLN-KEQxp2fFpOfSuJbiU/edit#heading=h.qgl302eyozqdminutes/a, the a href=https://docs.google.com/a/association.drupal.org/document/d/1DlaoBKlx1hQlj2QpLmOixXnh-p1tBYUVIDkFhEvbtjU/editmaterials/a, or the a href=https://www.youtube.com/watch?v=2dGoUCZfIy8meeting recording/a to catch up on all the details, and here's a summary for you as well./p h3 Staff Update/h3 pstrongDrupalCons:/strong DrupalCon Amstedam is over, and we are now focused on evaluation of the event - reviewing all the session and conference evaluations as well as closing up the financials for the event. We will have an in-depth review of the event at the December board meeting. Next up is a href=https://latinamerica2015.drupal.org/DrupalCon Latin America/a, which is progressing nicely now with sessions accepted and registration open. One final DrupalCon note is that DrupalCon Los Angeles session submissions should open in January, so mark your calendars for that./p pstrongDrupal.org: /strongDrupal.org has been our primary imperative at the Association this year. We've spent 2014 building a team and really working to pay off a mountain of accumulated technical debt while also balancing the need to release new features for the community. We are very pleased that, with the working groups and community feedback, we've been able to release a a href=https://www.drupal.org/roadmapDrupal.org roadmap/a for 2015. We also released a new a href=https://www.drupal.org/termsTerms of Service/a and a href=https://www.drupal.org/privacyPrivacy Policy/a after extensive edits based on community feedback. We'll continue to respond to questions and ideas about these documents and make notes for future releases. We have also finally been able to deploy and use a suite of over 400 tests on Drupal.org. This is work that was initiated by Melissa Anderson (a href=https://www.drupal.org/u/eliza411eliza411/a) and she was extremely helpful in getting those tests up and running again. We're thrilled to be using this contribution after all this time and are extremely grateful to Melissa./p pstrongCommunity Programs: /strongWe just held our final Global Training Days for 2014 with over 80 companies on every continent but Antarctica (c'mon penguins!). This program has continued to evolve with new partnerships and currciulums used this time around, as well as a plethora of great photos and tweets sent our way./p pstrongMarketing and Communications:/strong Joe Saylor and our team have been working with the Security team to develop a follow up to the recent security announcement focused on the lessons learned and changes our community has made in response to the situation. It's another great example of an Association and community volunteer partnership./p h3 Licensing Working Group/h3 pAs we discussed in the a href=https://drive.google.com/drive/#folders/0B-RxSgrdyiH0MjM1MzQxMGUtMTlmZi00YWMwLTg4OTAtMjYyNmM5ODQzZmEx/0B8gZDNT4xrvZTjk4TlBwTWVEZTQ/0B8gZDNT4xrvZLV80d1ZxT1gwaW8August board meeting/a, some community members have expressed concern over the slow and sometimes inconsistent response to licensing issues on Drupal.org. In response, a volunteer group came together to a href=https://groups.drupal.org/node/445098draft a charter/a which was published for comment just after DrupalCon Amsterdam. Some of the main points from the charter include:/p ulli All members (chair + 4-5) appointed by the Board
/li li Scope is limited to licensing of code and other assets on D.O only, not other sites, and not determining WHICH license is used
/li li Group responds to issues, does not police for issues
/li li Will maintain the whitelist of allowable assets/li /ulpThe Association board voted to adopt the charter, so our next steps are to recruit members, create a queue for licesning issues, and then provide some legal training for our new Working Group members. If you are interested in participating, you can a href=https://assoc.drupal.org/licensing-working-group-self-nominationnominate yourself for the Working Group/a. We are planning to present a slate of candidates to the board for approval in the January 2015 meeting./p h2 3rd Quarter Financials/h2 pOnce per quarter, the board discusses the previous quarter's financial statements and then votes to approve and publish them. In the November meeting the board approved the Q3 financials:/p ulli a href=https://docs.google.com/a/association.drupal.org/spreadsheets/d/1Y2uDm6-LSHi9ocvfyeSIkN2qZCnmhaqlVxi0R571G7k/edit#gid=2130270226July 2014/a/li li a href=https://docs.google.com/a/association.drupal.org/spreadsheets/d/1yqbV83dnl6lGbtCHVsCIoM_SRlo2dVumDq_lhs2UyZE/edit#gid=212183559August 2014/a/li li a href=https://docs.google.com/a/association.drupal.org/spreadsheets/d/1475JpPjsDD2oGY4MhbdddVvl9qj3H1Ewdjv8Aj0_lA4/edit#gid=679096604September 2014/a/li /ulpI recently wrote a a href=https://assoc.drupal.org/blog/holly.ross.drupal/how-read-association-financial-statementspost highlighting how to read our financial statments/a, but will summarize here for you as well. Generally speaking, we are performing well ahead of our budgeted deficit spend. Though we had planned for a -$750,000 budget for 2014, a combination of slow tech team hiring, savings on Drupal.org contractor expenses, and some better than budgeted revenue means that we will not operate at nearly that level of loss for 2014. Instead the burden of the staffing investment we've made will really be felt in 2015. We'll see more of this and have a larger discussion when we release our budget and leadership plan next month./p pAs always, please let me know if you have any questions or share your thoughts in the comments./p pemFlickr phtoo: a href=https://www.flickr.com/photos/steffenr/15232316799/in/photolist-pd2B6H-pd3D2c-psuCUS-pd33LG-pd333C-ptBLbz-przGqq-ptBLSz-ptBMcn-ptBNQn-ptBLGK-pc8Poa-ptBMnc-ptBMvt-pc8pMy-pc8q7S-pc85BG-pc8sh3-przGKy-pc8pPY-pc87b3-ptBPgc-pc8rgq-pqQcAC-pgCL43-py6vYJ-pgD5yt-py6vdW-pd3DgR-pgC4QD-py6vF9-py8UPH-pbnwZ9-pbnwWU-pbnxgw-psScG2-psQxmy-pqQbSo-psSdqX-pboh28-pszVrp-pbnwHs-pbogUp-pszVDD-pqQcjW-pqQcnw-pbnwSA-pbohtF-pqQbCq-pqQbE9steffen.r/a/em/p /div/div/div
Categories: Drupal Feeds

Drupal core announcements: Drupal 8 beta 4 on Wednesday, December 17, 2014

Tue, 11/25/2014 - 7:54pm
pThe next beta for Drupal 8 will be beta 4! Here is the schedule for the beta release./p table tr thTuesday, December 16, 2014/th tdOnly critical and major patches committed/td /tr tr thWednesday, December 17, 2014/th tdDrupal 8.0.0-beta4 released. Emergency commits only./td /tr /table
Categories: Drupal Feeds

Forum One: Using Panels without Panelizer

Tue, 11/25/2014 - 4:23pm
pThe Panels and Panelizer modules have opened up a whole world of options for layouts in Drupal, but too often the usage and features of these powerful tools get confused. My goal with this post is to explore some of the capabilities the Panels module has to offer before ever getting into the realm of using Panelizer./p pAt a high level, the goals of each of these modules break down into the following:/p ul lia href=https://www.drupal.org/project/panelsPanels/a: Create custom pages with configurable layouts and components./li lia href=https://www.drupal.org/project/panelizerPanelizer/a: Configure Panels layouts and content on a per instance basis for various entities./li /ul pOften, I see both modules added and used when Panelizer isn’t needed at all. What#8217;s the problem with that? Introducing Panelizer when it isn’t needed complicates the final solution and can lead to unnecessary headaches later in configuration management, content maintenance, and system complexity./p h2Panels and Panel Variants/h2 pBefore the introduction of Panelizer, site-builders got by just fine with Panels alone. This original solution is still valid and just as flexible as it ever was. The secret in doing this lies in understanding how variants work and knowing how to configure them./p h3bDefault Layout for All Nodes/b/h3 pOnce Drupal finds a Panels page in charge of rendering the page request, Panels proceeds through the page’s variants checking the defined selection rules on each. Starting from the first variant, Panels evaluates each set of selection rules until one passes. As soon as a variant’s selection rules pass successfully, that variant is used and the rest below it are ignored. This is why it’s important to pay attention to the order in which you define your variants to ensure you place less strict selection rules later in the sequence./p pUsing this to your advantage, a good common practice is to define a default variant for your Panels page to ensure there is a baseline that all requests can use. To do this, you’ll need to define a new variant with no selection rules, so the tests always pass, and place it last in the series of variants. Since the selection rules on this variant will always pass, be aware that any variants placed below it will never be evaluated or used./p pimg class=alignnone wp-image-5463 size-large src=http://forumone.com/wp-content/uploads/2014/11/PanelizerBlog1-700x392.png alt=Screenshot of variant rule width=700 height=392 //p h3bCustom Layouts per Content Type/b/h3 pOnce you have a generic default in place to handle the majority of content items for your Panels page, you can start to tackle the pages that might have more specific or unique requirements. You can do this by creating a new variant above your default and define selection rules to limit its use to only the scenarios you’re targeting./p pimg class=alignnone wp-image-5464 size-large src=http://forumone.com/wp-content/uploads/2014/11/PanelizerBlog2-700x293.png alt=Screenshot of Panel Content width=700 height=293 //p pA common use case for this is the changing layout for content based on content types. To build this out, you need to edit the default node_view Panels page and add a new variant. If this page variant is intended to handle all nodes of this type, I’ll typically name it with the name of the content type so it’s clear. The next step is to configure the selection rules by adding the “Node: Bundle” rule and select the content type we’re building for. Once you save the new variant, any detail pages for that content type should render using the new configuration./p pimg class=alignnone wp-image-5465 size-large src=http://forumone.com/wp-content/uploads/2014/11/PanelizerBlog3-700x252.png alt=Screenshot of Reorder Variants width=700 height=252 //p pBuilding on this, a single page can be expanded to handle any number of variants using any combination of selection rules necessary. It’s common to see a variant added for each content type in this way. Examples of further customizations that are possible include:/p p•    A specific layout for a section of the site matching a specific URL pattern/p p•    Separate layouts based on the value of a field on the entity/p p•    Alternate views of a page if the user doesn’t have access to it/p p•    Separate views of a page based on the user’s role/p pThanks to CTools, these selection rules are also pluggable. This means if you can’t find the right combination of selection rules to enforce the limitation you need, it’s easy to write a new plug-in to add your specific rule./p h2Avoiding Too Many Variants/h2 pUsing the existing selection rules allows for a great deal of flexibility. Adding in custom plugins further improves your options to define any number of increasingly specific variants./p pIt is possible to take this too far, however. The cost of creating a new variant is that your layouts and content configurations are now forked further. Any common changes across them now have to be maintained in independent variants to maintain continuity./p h3bVisibility Rules/b/h3 pIt’s important to also remember the other features Panels offers, including visibility rules. Visibility rules are configured on a per-pane basis inside a specific variant’s layouts. These rules offer the same conditions available in variant-level selection rules. Since they’re configured on individual panes, however, you can focus on the component-level differences between pages. A common use case for this is to use the same node variant for multiple content types with similar layouts and configure the unique panes with visibility rules to limit which pages they show on./p pimg class=alignnone wp-image-5466 size-large src=http://forumone.com/wp-content/uploads/2014/11/PanelizerBlog4-700x468.png alt=Screenshot of Visibility Rule width=700 height=468 //p pTo elaborate on this, here#8217;s an example. Assuming a default node variant with a two-column layout, we can define the common elements that all nodes will have, such as the page title, rendered content, and maybe a sidebar menu. If we then add the requirement that all article nodes include a list of similar articles in the sidebar, we can accomodate this by placing the correct pane in the sidebar and adding the visibility rule “Node: Bundle”. We’ll then configure it to use the current node being viewed and limit it to show only when that node is in the “Article” bundle. Now, whenever a node is displayed, it will show the common panes, but the block for similar articles will only show in the sidebar if we’re viewing a article node./p pimg class=alignnone wp-image-5467 src=http://forumone.com/wp-content/uploads/2014/11/PanelizerBlog5.png alt=Screenshot of Node:Bundle width=500 height=495 //p h2img class=alignnone wp-image-5468 src=http://forumone.com/wp-content/uploads/2014/11/PanelizerBlog6.png alt=Screenshot of Article Bundle width=499 height=335 //h2 h2Choosing the Right Approach/h2 pOnce you get to the level of creating panel variants or visibility rules just for single pages, it’s usually time to ask if you’re using the right tool. When you’ve gotten to the point where individual page instances need to be different, you’ve come to the impasse of determining the best approach./p pIf it’s only a handful of pages that are each unique, then the most straightforward solution may be to create independent Panels pages for each of these./p pIf instead, individual instances of the same type need different layouts or configurations, then it may be time to install Panelizer to allow instance-specific overrides./p pnbsp;/p
Categories: Drupal Feeds

groups.drupal.org frontpage posts: Google Code-In 2014 starts Dec 1st and Drupal is back!

Tue, 11/25/2014 - 4:12pm
pIt's that wonderful time of the year when Google Code-In students (ages 13-17) work on tasks for Drupal. Starting on Monday December 1st, hundreds of students from around the world will be contributing tasks to open source organizations competing to win an all expense paid trip to visit Google in California. Luckily Drupal was invited back by Google to participate in 2014 and timing could not be better with the beta releases of Drupal 8. Thanks Google!/p pThe Code-In contest will end January 19th 2015 and Drupal has an awesome chance to connect with the youth of computer programming. Did you know that many of Drupal's top contributors started in Google Summer of Code and/or Code-In? Even if you don't have ideas for tasks, nor want the responsibility of being a mentor, please hangout on IRC in #drupal-google to help students and prepare for a flood of questions in #drupal-contribute./p pDrupal gained priceless experience and contributions in GCI 2013. We're proud to note that several students even became Drupal 8 core contributors. In addition to helping Drupal during GCI, a few students have continued contributing to our community after the contest. A final congratulations to our 2013 winners areke and royal121, we thank you for all your hard work. Moving forward we're excited to continue our momentum of contributing to Drupal while having fun educating the next generation of developers./p pHow can the Drupal community participate? Drupal needs help until the end of contest in January. It is not too late to help. We need task ideas and of course we're always looking for additional mentors. Maybe you can help us by promoting GCI to social media or mentioning it to colleagues? Did we mention you don't have to be a mentor to create tasks? Learn how to add tasks and become a mentor in details below./p pbHow to become a Drupal GCI Mentor/b/p ul liLog into Melange with Google account @ a href=http://www.google-melange.com/gci/profile/register/org_member/google/gci2014http://www.google-melange.com/gci/profile/register/org_member/google/gci2014/a/li liClick Register to be a Mentor/li liConnect with Drupal (wait for approval)/li liContact Slurpee on d.o if issues/li /ul pbHow to Add Drupal GCI Tasks/b/p ul liAdd tasks to bottom of our spreadsheet in lowest open task number @ a href=https://docs.google.com/spreadsheets/d/1sFf5wnuCSkNauNw26-Kml0snplF4Fx0jtw5xGWNSUeY/edit#gid=1582128900https://docs.google.com/spreadsheets/d/1sFf5wnuCSkNauNw26-Kml0snplF4Fx0jtw5xGWNSUeY/edit#gid=1582128900/a/li liAdd a Title and Description/li liTime is number of hours to complete (usually a few days)/li liEnter mentor/s name same as username in Melange/li liTasks may be part of multiple categories based on (Code, Documentation/Training, Outreach/Research, Quality Assurance, User Interface)/li liTags to help students find certain types of tasks/li /ul pbImportant Links/b/p ul liGoogle's GCI Homepage - a href=http://www.google-melange.com/gci/homepage/google/gci2014http://www.google-melange.com/gci/homepage/google/gci2014/a/li liDrupal's GCI Homepage - a href=https://groups.drupal.org/google-code-inhttps://groups.drupal.org/google-code-in/a/li liGCI FAQ - a href=http://www.google-melange.com/gci/document/show/gci_program/google/gci2014/help_pagehttp://www.google-melange.com/gci/document/show/gci_program/google/gci2014/help_page/a/li liGCI Announcement - a href=http://google-opensource.blogspot.com/2014/11/get-scoop-on-mentoring-organizations.htmlhttp://google-opensource.blogspot.com/2014/11/get-scoop-on-mentoring-organizations.html/a/li /ul pMore information will be available as the contest gets started. Subscribe to gdo/code-in to hear the latest updates. More info soon./p
Categories: Drupal Feeds

Colan Schwartz: How to review Drupal code

Tue, 11/25/2014 - 3:26pm
section class=field field-name-field-blog-topics field-type-taxonomy-term-reference field-label-inline clearfix view-mode-rss clearfix h2 class=field-labelTopics:nbsp;/h2 ul class=field-items li class=field-item even rel=schema:keywords a href=/blog-topics/drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal Planet/a /li li class=field-item odd rel=schema:keywords a href=/blog-topics/drupal-7 typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Drupal 7/a /li li class=field-item even rel=schema:keywords a href=/blog-topics/quality-assurance typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Quality Assurance/a /li /ul /section div class=field field-name-field-body field-type-text-long field-label-hidden view-mode-rssdiv class=field-itemsdiv class=field-item even property=schema:articleBodypIf you're interested in code quality and providing a means by which to bring a href=https://www.drupal.org/Drupal/a beginners up-to-speed on the coding standards, I recommend reviewing code from all developers. I say all developers because everyone needs an editor./p pThe best way to force code reviews is to bake it into your development process. Use a tool like a href=https://about.gitlab.com/Gitlab/a (a href=https://gitlab.comfree hosted version/a) to prevent developers from committing code to authoritative branches. Instead, have them fork the project repository, and submit merge requests. Someone else can then review them. The reviewer can add in-line comments, wait for the developer to make changes, and then accept the request./p pHere are some things to look for when reviewing Drupal code submissions. For some of these, we're assuming a href=https://en.wikipedia.org/wiki/Git_(software)Git/a is being used for version control./p olliRead, understand and follow the a href=https://www.drupal.org/coding-standardsCoding standards/a./li liInstall, enable, and use the a href=https://www.drupal.org/project/coderCoder/a module on your development sites./li liFor the purists out there, use the a href=https://www.drupal.org/project/coder_tough_loveCoder Tough Love/a module as well./li liIf you're running a a href=https://en.wikipedia.org/wiki/Continuous_integrationcontinuous integration (CI)/a system like a href=https://en.wikipedia.org/wiki/Jenkins_(software)Jenkins/a, check the logs for new errors or warnings on new commits. Either way, make sure your development sandboxes have errors being reported to the screen so that developers can see any new errors that they generate. You'll find a lot of errors in your Drupal log if you're not doing this. (Make them refresh their DBs from your Dev site which already has this enabled.)/li liSpeaking of CI, add one or more code quality inspection tools to the mix such as a href=https://en.wikipedia.org/wiki/SonarQubeSonarQube/a. There's actually a pre-configured a href=https://en.wikipedia.org/wiki/Vagrant_(software)Vagrant/a profile to build a a href=https://en.wikipedia.org/wiki/Virtual_machineVM/a with everything already set up. See a href=http://www.midwesternmac.com/blogs/jeff-geerling/ci-deployments-code-analysis-drupal-phpCI: Deployments and Static Code Analysis with Drupal/PHP/a for details./li liLook for unrelated code reversions in merge requests. That is, if you see code changes that aren't related to what the developer is trying to do, there's something wrong. In most cases, this means the developer's branch is out-of-date with the main development branch. He or she should fetch and merge that branch from from the origin repository, fix any conflicts, and then add it to the merge request./li liLook for debugging code that wasn't removed such as a href=https://api.drupal.org/api/devel/devel.module/function/dd/7dd()/a, a href=https://api.drupal.org/api/devel/devel.module/function/drupal_debug/7drupal_debug()/a and other output functions./li liLook for Git conflict symbols such as lt;lt;lt;, gt;gt;gt; and ===. These usually indicate a botched conflict resolution./li liNotice any lack of comments. Stanzas (small blocks of code that do little things) should be separated by blank lines, each with a comment explaining what it does. It may be clear to the original developer, but that doesn't help anybody else./li liMake sure that modules are installed in the right place. This is usually sites/all/modules/contrib (for upstream modules coming from drupal.org) or sites/all/modules/custom (for modules written specifically for the project)./li liIn theme files, usually somewhere under sites/all/themes, look for any functionality that is not theme-specific. Functionality should always be in modules, not themes, so that if the theme is changed, the site still works as expected. This is an extremely common error for beginners. For example, JavaScript files related to modules shouldn't be in the theme directory, but the module itself./li liEnsure consistency in module package names. For custom modules, it's advisable to give the package name the name of the project so that it's clear that these are site-specific. For contributed modules, use what others are using; don't arbitrarily make one up. This helps keep your list of modules organized./li /olpThese are the most common issues I've discovered while reviewing code. If you have any others, feel free to add them as comments. I can add them to the list here./p pHappy reviewing!/p /div/div/divspan rel=schema:url resource=/blog/how-review-drupal-code class=rdf-meta element-hidden/spanspan property=schema:name content=How to review Drupal code class=rdf-meta element-hidden/span
Categories: Drupal Feeds

Bert Boerland: Drupal SplashAwards 2014

Tue, 11/25/2014 - 3:13pm
pa href=https://www.flickr.com/photos/bertboerland/15692586029 title=Drupal-splash-awards-2014_klein_600x400 by bert boerland, on Flickrimg src=https://farm9.staticflickr.com/8561/15692586029_2c81fcc1f2_z.jpg width=600 height=400 alt=Drupal-splash-awards-2014_klein_600x400/abr / On december 12 the a href-http://stichtingdrupal.nlDutch Drupal Foundation/a will organise the first edition of the a href=http://splashawards.org/SplashAwards/a. This award is to put outstanding projects in the spotlight, the best Drupal projects and community contributions from Belgium and The Netherlands. /p pBoth Drupal agencies and individuals who have achieved extraordinary results get special recognition from inside and outside the Drupal community. The international jury selects winners out of hundreds of contestants in several categories including best government project and best Drupal theme. /p pThe jury includes well known people in the broader PHP and Drupal community from all around the world: Joost de Valk (SEO WP fame) , Moshe Weitzman (contributor since 2001), Jeffrey jam McGuire (evangelist with a mo), Holly Ross (Executive Director DA) , Morten Birch Heide-Jorgensen (enfant terrible and good friend :-)), Stefan Koopmanschap (PHP / Symfony guru from the Netherlands) , Guido Jansen (magento fame) and Robert Douglass (SOLR fame and most of all around friendly chap) will select the ten winners who will walk home along the canals with a great award and a smiling face./p pThere are 10 awards to be given, from architecture and commerce to best governmental site and theme. The award self will be held for some 100 people, in an a href=http://uitkijk.nl/zaalhuur/old cinema/a in the centre of Amsterdam. We are really looking forward to this event. And in fact, it will be the last event of the year for the Dutch and a great year it has been. /p pimg src=http://www.ordina.nl/~/media/images/ordinanl/blogs/2014/_mg_2980.jpg From a record breaking a href=http://drupaljam.nlDrupalJam/a, via the social events around a href=https://amsterdam2014.drupal.org/DrupalCon/a to 100's of students getting a free training on the a href=http://drupaltrainingday.nl/Drupal Training Day/a and now the bowtie SplashAwards, showing of the Dutch Drupal community never was better. /p
Categories: Drupal Feeds

3C Web Services: Creating dynamic output on your entity in Drupal 7 using hook_entity_view()

Tue, 11/25/2014 - 3:00pm
pIf you need to create dynamic output on an entity when it is displayed on your Drupal site you have multiple options. One method that is easy to implement is strongusing hook_entity_view()/strong./p pYou can insert this hook function into your custom module (see creating a custom module for more info)./p pemExample:/em/p
Categories: Drupal Feeds