Recent comments

  • Writing robust code that uses fields, in Drupal 7   2 years 41 weeks ago

    It ends up being
    $wrapper->field_image->file->value()->uri

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 43 weeks ago

    Thank you very much for sharing this informative post. The Drupal module ensures that the Symfony Framework module is available to other modules. You should not have to install it unless another module asked you to.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 43 weeks ago

    You’ll be surprised to know that drush and Aegir can do significantly more than Capistrano and composer, in certain areas. For example, you can setup and run Drupal with your own set of modules just from console - without editing single file.
    Try to do it from composer in Symfony2. You, at least, will need to add bundles to
    your AppKernel, I’m not even saying about manual configurations of multiple files.

    Here is the typical Drupal deployment:

    git pull
    drush updatedb
    drush cc

    And you can still use cap which will use drush, of course - since cap gives some good features to your deployment, like maintaining old releases and quick rollbacks.

    I’m not saying that Symfony infrastructure is bad, or composer is bad, or Capistrano is bad.
    They are very good!
    But it’s funny that some Symfony and ‘OOP’ fans think of Drupal like about some stupid ancient procedural set of scripts with ‘@’ error blocking in every line.
    I saw some guy writing “Why they don’t just rewrite their Drupal so it’s a bundle” in news about Drupal8 using Symfony2 components. This guy probably assumes it’s like a week of porting.
    Drupal is more than that :)
     Peace!

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 43 weeks ago

    My deployment to MULTIPLE production servers is as hard as typing: cap prod deploy
    All that takes is 20 minutes to setup configuration and production servers.

    Ant that does everything.. uploads code, installs vendords, runs migrations, bumps version, etc.

    I can't even imagine pains in drupal deployment on multiple machines.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 43 weeks ago

    1) Indeed, point taken, it's not meant for that kind of projects :)
    2) Yes, you depend on github, if you call composer install when deploying. You can build an artifact. By this, I mean a .zip which already contains all the dependencies. Then, just uncompress on prod, and, if your project root is symlinked, change the symlink. Virtually no downtime.
    3) The 3rd parameter from the Translator::trans() method isn't the bundle, but the catalog. It's used to prevent collision of translation names.

    In drupal, if you have the same text in various modules, but under different context (a translation of a polysemic word), it may mess up with the translation.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 43 weeks ago

    Thanks for your points!

    1) If you develop in production? Ugh. Maybe symfony ain’t for you if you do that.

    I do, for projects with small budget and <50h of work. And a lot of people does. Because most of small projects is not about deployment beauty, or good testing, but about getting things done.
    That’s what I’m trying to say - symfony2 and “get things done” approach doesn’t live together in small projects (it’s just my humble opinion, based on my experience).

    2) You need to call composer install not composer update on production, and install is faster than update, since it doesn’t have to resolve dependencies and such. In fact, you can configure composer so that it runs all the scripts you need after a deploy.

    At the moment, to deploy on some live servers, I do the following: git pull && composer install && app/console doctrine:migrations:migrate

    That’s right, you do composer install, definitely - it’s my mistake, I’ve fixed the text, thanks!

    But all the facts about update still apply to install command:
    if you do composer update on dev and then deploy to production and run composer install on prod, you can still break your website if some package website is offline or is just not working correctly for your composer, right now.
    If every package in project is on github, and your own repo is own github, your approach can work, that’s true :)

    3) $this->get(‘translator’)->trans(‘flash.create.success’, array(), ‘JordiLlonchCrudGeneratorBundle’); vs t(‘The node was created successfully’);. Hi unfair comparision. How about $this->get(‘translator’)->trans(‘flash.create.success’);, which is how it’d look if you only have one catalog.

    What do you mean by “catalog” here?
    The translation is inside this specific bundle. If you omit ‘JordiLlonchCrudGeneratorBundle’ part in my specific case, you will get ‘flash.create.success’ in browser, not the proper translation.
    If you tell me the elegant way to bypass this, I will be happy to try it :)

    Drupal t() function is smart enough to find translation from any module, you don’t need to specify module which holds the translation (that leads to performance and other kinds of issues, definitely - but that’s not the point of discussion, since I was talking about code length).

    Thanks!

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    I see this to be a little biased. Some points.

    1) If you develop in production? Ugh. Maybe symfony ain't for you if you do that.

    2) You need to call composer install not composer update on production, and install is faster than update, since it doesn't have to resolve dependencies and such. In fact, you can configure composer so that it runs all the scripts you need after a deploy.

    At the moment, to deploy on some live servers, I do the following: git pull && composer install && app/console doctrine:migrations:migrate

    3) $this->get('translator')->trans('flash.create.success', array(), 'JordiLlonchCrudGeneratorBundle'); vs t('The node was created successfully');. Hi unfair comparision. How about $this->get('translator')->trans('flash.create.success');, which is how it'd look if you only have one catalog. Heck, you can, as you stated, add a method to the base controller. And you don't have to do it on all your projects, create your own library which ships the changes you want, and include it. $this->crudTranslationMessage('flash.create.success')

    I found the post really interesting, but I wanted to rebate some of the bashing on Symfony2.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Haha Jordi :) thanks for the nice bundle!

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    I can only say, sorry for put my name in the bundle ;) My bundle was a way of learning how create Sf2 bundles. It was an experiment and now some people are using it and I happy of that, of course.
    By the way, if someone is interested in how my name is pronunced: /xordy yɒŋ/ :D
    Thank you of talk about my bundle :)

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Agreed - thanks for the honest article, VERY helpful.

    There is a use case that may be beneficial to my company – we have a few client sites that are event voting platforms that are simplistic in function but have a high traffic load across a short period of time. They require authenticating the users and processing 1 or 2 simple forms. With these sites the development time is relatively small to begin with and may ultimately save the client money if we could back off on load balanced server resources needed to execute their campaign.

    Thanks!

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    the summary is correct, thanks, Larry :)
    Drupal 8 will be interesting, indeed. But the transition from d7 won’t be painless for most of contrib, for sure.

  • Improving user experience: using Dialogs for profile edit in modal forms   2 years 44 weeks ago

    Hey, thanks for writing this up. I've been looking at several blogs to find something like this. Do you by any chance have a contact email that you could share? I would like to contact you directly.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Great writeup, Anton!

    If I may, it sounds like the summary is "Symfony is more elegant and proper, but Drupal gets the job done." Which means Drupal 8 (rewritten to leverage Symfony Components and follow many of the same "elegance" standards, but not all of them) should be very interesting indeed. :-)

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    I completely agree and I should say Python is my favorite language :)
    The thing here is that we have lots of projects to maintain, and it’s not me as single developer, it’s a team. So, we decided to stick to PHP for our business needs.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Being a Drupal developer for years I started looking for a framework for projects when client needs more speed and flexibility. I looked at all major PHP frameworks and saw that Symfony is the most solid project in PHP. After spending two weeks with Symfony 2 I was so pissed of with it that I came to conclusion that it will be worth to look at another languages. I tried Ruby on Rails / Ruby and Django / Python and felt in love with the later.

    Python's learning curve is pretty much low when you already know one or two programming languages. Additionaly, comparally to PHP you need to type twice less. When it comes to Symfony 2 vs Django comparison... well, no holywar there, but Django is more developer friendly and you need from two to three times less code to accomplish the same task with it comparally to S2. I'm not even talking about the number of libs/packages/apps/whatever you call it: Django and Python have way bigger selection of these.

    And the best thing in learning Python is that I started writing better PHP code for Drupal mostly because of a breath of fresh air that Python/Django gave me.

    Just my five cents.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Ok, indeed in this case this is more verbose than Drupal.

    That's the Symfony way. On Symfony 1.x, there were helpers to do this in templates, and you could use them in the controller, but it wasn't recommended.

    I think that this is a volontary effort to make things the more explicit as it can be, but believe me, it stays less verbose than Java :)

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Hi,
    the flash message is set just when item was created - so, it’s controller, not template.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Hi,

    About I18N, there is a simplier way :

    http://symfony.com/doc/current/book/translation.html#book-translation-tags

    Inside Twig template, for example :

    {% trans %}Hello %name%{% endtrans %}

    {% transchoice count %}
    {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples
    {% endtranschoice %}

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    That’s a brilliant post, thanks!
    We still like to cut corners :)
    I’ve updated my post, removed the “fork” words.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Thanks! I agree.
    I would say, Symfony2 is (mostly) an area for professional products and custom/highload projects, not corporate/content websites. Though you can develop good content website in Symfony2. Good, and probably expensive :)

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Thanks for a thoughtful and well written post. I guess given the costs and time, you have confirmed drupal as the best choice if it's a good fit for the project.

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    The RAD efforts are not a fork and imho they should not be added to core. I have written on this topic at length on my blog http://pooteeweet.org/blog/2205

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 44 weeks ago

    Thanks for the refreshingly honest post about your experiences with both! Most posts come from one camp or the other and show some bias, but you dealt with both fairly.

    The same project will cost roughly twice as much developed in Symfony, comparing to Drupal, and will take twice as much time.

    That seems like a pretty damning quote! Most clients in the web space I've worked with don't consider maintenance when deciding on a project. Maybe short-sighted on their part, but it rarely comes up. Hearing a word like 'double' would instantly remove sf2 from the conversation.

  • Improving user experience: using Dialogs for profile edit in modal forms   2 years 51 weeks ago

    I have done the same updrade with my Drupal 7. It's very convenient and natural. I followed your easy-to-follow step very carefully as the coding requires attention-details.

  • Adding "Price" field to Ubercart cart page   3 years 2 weeks ago

    Hi, my cart shows item price thanks to your solution.

    After playing(==painful) around ubercart, i installed ubercart custom price module. https://drupal.org/project/uc_custom_price

    With the above code, total price shows my custom price but item price shows original price (price that custom price calculation is not applied).

    This is way over my knowledge, so here i am asking if you can share some tips. thank you. :-)

Drupal association member