Recent comments

  • Packt Publishing book - Premium Drupal themes   2 years 27 weeks ago

    Congratulations!! Hope you can accomplish your goal of becoming an authore real soon.

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

    Well, I think that the level of maturity of both systems (Drupal and Symfony) is good enough, and the length of development lifecycles of new major version is so big that most of websites can live happily for 3-4 years without upgrading to younger major version. I have few examples of big projects upgrading from Drupal 5.x to 6.x, and from Drupal 6.x to 7.x, and it definitely requires fair amount of time.

    At the same time, I have yet to see any big Symfony 1.x project that was converted to 2.x. The db schema can probably live without big changes, but I suspect the amount of code rewriting will be the same or even bigger here than in Drupal world.

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

    With statements like "The same project will cost roughly twice as much developed in Symfony, comparing to Drupal, and will take twice as much time.
    I think the learning curve is approximately the same for Drupal7 and Symfony2" - I wonder if you are factoring in project life cycle (i.e. development over time).

    What I've found with drupal is that major version upgrades (on reasonably sized sites on up to more complex with lots of modules) are a complete pain requiring you to essentially rebuild your site. While with a framework, you can likely stay up to date more easily and focus on adding features and improving performance over the years.

    While you could argue that this rebuilding time is a good time to rebuild functions, etc. - it also involves essentially spending hours/months rebuilding things that worked fine to begin with.

    I think when you factor upgrades and feature additions in over time a framework will likely win for anything but the most basic of sites - and for those drupal if you follow all the conventions is as good as it can be in my opinion.

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

    Hello,

    which is the file where you have to write this code? I'm desperate

    Thans !!!

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

    Hey, how to work with empty fields with wrappers?

    I'm always getting the exceptio when the field is empty:

    EntityMetadataWrapperException:
    Unable to get the data property [prop name (amount)] as the parent data structure is not set.

    Here is my code:
    $order_wrapper->owner->field_discount_limit->amount->value() // field_discount_limit is empty

  • Be careful with drupal_get_form() in theme layer   2 years 31 weeks ago

    This saved my day! Thank you very much!

    Now to something completely different: I need a Beer. print render($beer);

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

    Hi :)
    I'd like to come back to the following part:

    The same project will cost roughly twice as much developed in Symfony, comparing to Drupal, and will take twice as much time.
    I think the learning curve is approximately the same for Drupal7 and Symfony2.

    Is this true? If you got several projects with Symfony and write own bundles for reoccuring problems (login, content creation, base theme etc.) in which way does it take more time than using Drupal?

    I know, as an Drupal Developer, that some custom features can be a pain in the ass to implement in Drupal, mostly due to the "Drupal way". If, after some time, you had such a list of own bundles, ready to use in a new project, wouldn't that kickstart your development?

  • Writing robust code that uses fields, in Drupal 7   2 years 36 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 38 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 38 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 38 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 39 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 39 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 39 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 39 weeks ago

    Haha Jordi :) thanks for the nice bundle!

  • Drupal 7 vs Symfony 2: overview after 1 year of Symfony development   2 years 39 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 39 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 40 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 40 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 40 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 40 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 40 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 40 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 40 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 40 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 association member