ROBO47.NET
Nav
  • Blog
  • Tools
  • Texte
  • Codeschnipsel
  • Tag-Cloud
  • Archiv
  • Sitemap
  • Suche
  • Datenschutzerklärung
  • Impressum
Blogroll
  • Benjamin Steininger
  • Sebastian Schmitt
  • shuttercount.io
Flattr this
  • What can go wrong on switching application-context in symfony 1.4

    07.03.2012 20:04
    Tags: symfony1, crud

    Tweet this: What can go wrong on switching application-context in symfony 1.4 Dent this: What can go wrong on switching application-context in symfony 1.4 Flattr this
    It's was the end of my first week after the winter holidays and I noticed something strange in the working branch of the base applications backend. Most parts of this backend were based on the admingenerator. Each plugin hooks itself into the backend, includes menus, configuration and has generator based CRUDs for its models.

    Listing, editing, creating new entries all no problem. But deleting wasn't possible in the list-view, it always showed me the errorpage of symfony, deleting an entry from the edit-page worked.

    Switching to dev-mode showed me a csrf-warning. I cleared cleared and reset everything related to the application, deleted the sessions, restarted all services related, reset the database, created a new entry and tried to delete it ... again failing.

    Last point where it worked: before the holidays. Since I was the only developer touching the code, there wasn't anybody else to blame.

    Switching to another plugins generators, some had the bug, some didn't, now it was really getting weird, since all use the same modified theme as base, configurations was nearly the same.

    After hacking around with the generator.yml, trying everything and not getting anywhere I choose to just go back in time. Thanks to git aka version control, I went back commit by commit in a plugin which had the problem and it showed me where the problem was located.

    The problem was introduced by what looked like a simple feature short before the holidays: Linking from the admingenerator-list to the entries in the frontend by using the frontends context.

    After finding Accessing the frontend routing from the backend application and modifiying it a bit I used it to create columns in some generator lists which fetched the frontend-router and generated the url by using the router.

    Everything was perfect, expect, switching back with sfContext::switchTo($current_application); wasn't really enough to switch back to the backend-application. It reset sfConfig and some other things, but doesn't call sfApplicationConfiguration->initConfiguration(); which usally runs
    if (false !== sfConfig::get('sf_csrf_secret'))
    {
      sfForm::enableCSRFProtection(sfConfig::get('sf_csrf_secret'));
    }
    
    So what you need to do is running an additional
        $current_configuration->initConfiguration();
    
    after running the switchTo, else you application will use the csrf-tokens from the application you switched to and it probably has more sideaffects. Weiterlesen: What can go wrong on switching application-context in symfony 1.4
    Kommentare: 0
  • WYSIWYG Editor for Markdown and reStructuredText on Linux / Ubuntu

    06.03.2012 20:04
    Tags: WYSIWYG, Markdown

    Tweet this: WYSIWYG Editor for Markdown and reStructuredText on Linux / Ubuntu Dent this: WYSIWYG Editor for Markdown and reStructuredText on Linux / Ubuntu Flattr this
    Because I sometimes miss a needed linebreak or my lists don't look like expected in Markdown or reStructuredText (mainly for use with sphinx), I was looking for a better editor with some kind of live preview for linux. Normally I edited those files directly in Netbeans or Gedit. I found ReText a nice Gui-Editor written in python with QT for the frontend. It does exactly what i wanted, 2 Columns, one with markdown or reStructuredText, the other shows a live preview. For Ubuntu there is a PPA: https://launchpad.net/~mitya57/+archive/ppa which includes integration into the menu and you don't have to create the entry yourself to automatically open files If you don't install via the PPA you have to create the menu-entry yourself to be able to automatically open files with it since Ubuntu seems to no more support opening files with programs which aren't installed in the menu: Add Custom command in the Open with dialog. Weiterlesen: WYSIWYG Editor for Markdown and reStructuredText on Linux / Ubuntu
    Kommentare: 0
  • Extending Heise SocialSharePrivacy to pass a dynamic title to twitter

    07.12.2011 20:02
    Tags: Heise, SocialSharePrivacy

    Tweet this: Extending Heise SocialSharePrivacy to pass a dynamic title to twitter Dent this: Extending Heise SocialSharePrivacy to pass a dynamic title to twitter Flattr this
    Yesterday I had a look at Heise SocialSharePrivacy and experimented around with it (probably will integrate it here via a plugin) but one think I was missing was a way to use it on a list of items, while having different titles for the twitter text, not using the current pages title. Currently it only allows for a static title or a function. But the function was worthless in this case, since I wanted to use the title each specific link. Weiterlesen: Extending Heise SocialSharePrivacy to pass a dynamic title to twitter
    Kommentare: 0
  • ReflectionException: Method PHPUnit_Framework_Warning::Warning() does not exist

    30.11.2011 19:59
    Tags: phpunit, Reflection, PHP, dataProvider

    Tweet this: ReflectionException: Method PHPUnit_Framework_Warning::Warning() does not exist Dent this: ReflectionException: Method PHPUnit_Framework_Warning::Warning() does not exist Flattr this
    If you ever get
    ReflectionException: Method PHPUnit_Framework_Warning::Warning() does not exist
    
    That may be because you are using @dataProvider and your dataProvider returns the data in an invalid way. This may be caused by forgetting one dimension in the returned array when using only a single value as parameter for the test. Wrong:
    <?php
    
    public function myDataProvider()
    {
        $data = array();
    
        $data[] = 'some value i want to pass as param';
        $data[] = 'another value i want to pass as param';
    
        return $data;
    }
    
    Right:
    <?php
    
    public function myDataProvider()
    {
        $data = array();
    
        $data[] = array('some value i want to pass as param');
        $data[] = array('another value i want to pass as param');
    
        return $data;
    }
    
    Weiterlesen: ReflectionException: Method PHPUnit_Framework_Warning::Warning() does not exi ...
    Kommentare: 0
  • Automatic pushing to a remote git-repository with etckeeper

    08.11.2011 19:48
    Tags: Git, etckeeper

    Tweet this: Automatic pushing to a remote git-repository with etckeeper Dent this: Automatic pushing to a remote git-repository with etckeeper Flattr this
    A simple way is just to use etckeeprs hooks and create a script which does the pushing after all /etc/etckeeper/post-install.d/60vcs-commit-push
    #!/bin/sh
    set -e
    
    git push origin master
    
    And don't forget
    chmod +x /etc/etckeeper/post-install.d/60vcs-commit-push
    
    Weiterlesen: Automatic pushing to a remote git-repository with etckeeper
    Kommentare: 0
  • Identifier "request_context" is not defined with silex

    08.11.2011 19:48
    Tags: PHP, Silex, Symfony2, Twig

    Tweet this: Identifier Dent this: Identifier Flattr this

    If you ever receive a message like:

    Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Identifier "request_context" is not defined.' in phar:///.../vendor/silex/silex.phar/vendor/pimple/lib/Pimple.php on line 12
    
    And it is not directly about the AsseticExtension in Silex-Extensions,it is probably because some of your code wants access to the url_generator - in my case it was my own Routing-Extension for twig. Weiterlesen: Identifier "request_context" is not defined with silex
    Kommentare: 0
  • Netbeans, Symfony, Xdebug and the magical file_link_format

    08.11.2011 19:48
    Tags: Chromium, Netbeans, PHP, symfony1, Xdebug

    Tweet this: Netbeans, Symfony, Xdebug and the magical file_link_format Dent this: Netbeans, Symfony, Xdebug and the magical file_link_format Flattr this
    Originally I was looking for a solution to get Chromium to open Files in Netbeans directly from symfony1 stack traces, because some time ago in a video I had see how it was done for other editors. Weiterlesen: Netbeans, Symfony, Xdebug and the magical file_link_format
    Kommentare: 0
  • Creating your own git aliases based on your needs

    19.12.2010 11:56
    Tags: Git, git alias, zsh, bash

    Tweet this: Creating your own git aliases based on your needs Dent this: Creating your own git aliases based on your needs Flattr this

    If you want to create git aliases optimized for your daily work, you should start by analysing your shell logs to find out which git commands you use most of the time and create shortcuts for them:

    Weiterlesen: Creating your own git aliases based on your needs
    Kommentare: 0
  • Git, Aliases, Submodules and Symfony

    19.12.2010 11:42
    Tags: Git, git alias, gitconfig, git submodules, Symfony

    Tweet this: Git, Aliases, Submodules and Symfony Dent this: Git, Aliases, Submodules and Symfony Flattr this

    Some time ago i stumpled over Joel Perras (@jperras) blogentry Making Git Behave on twitter, covering the .gitconfig file and that was when I first found out about gits aliases and thanks to Joel I started to fill my gitconfig with more and more of them, speeding up my work with git und my working-environment for my mostly symfony based stuff.

    Weiterlesen: Git, Aliases, Submodules and Symfony
    Kommentare: 0
  • RuntimeException: PHP Fatal error: 'You cannot serialize or unserialize PDOStatement instaces' in -:31 - PHPUnit - Process Isolation and Doctrine/PDO

    03.10.2010 21:35
    Tags: phpunit, pdo, Doctrine, Symfony, process isolation

    Tweet this: RuntimeException: PHP Fatal error: 'You cannot serialize or unserialize PDOStatement instaces' in -:31 - PHPUnit - Process Isolation and Doctrine/PDO Dent this: RuntimeException: PHP Fatal error: 'You cannot serialize or unserialize PDOStatement instaces' in -:31 - PHPUnit - Process Isolation and Doctrine/PDO Flattr this

    If you ever get this message:

    RuntimeException: PHP Fatal error:  Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDOStatement instances' in -:31
    Stack trace:
    #0 [internal function]: PDOStatement->__sleep()
    #1 -(31): serialize(Array)
    #2 -(190): __phpunit_run_isolated_test()
    #3 {main}
      thrown in - on line 31
    

    Something with a doctrine/pdo went wrong in one of your tests, but since serialize does not work on pdo-classes, it prints out only this message.
    If you want doctrines/PDOs message, run only this one test with process isolation turned off and you will get the error-message.
    Really bad to debug on a continous-integration-system if it fails only there :)

    Weiterlesen: RuntimeException: PHP Fatal error: 'You cannot serialize or unserialize PDOSt ...
    Kommentare: 1
<12345678910>1/22

Letzte Kommentare

  • rama!: Hi! congratulation from Argentina for the post. I have got running MySQL Workbench from .deb's o...
  • gjerokrsteski: Habe es mal endlich geschafft das Ganze auf GitHub hoch zu laden. https://github.com/gjerokrst...
  • Dieter: Herzlichen Dank u. ein gutes erfolgreiches Neues Jahr MfG Dieter
  • Niko: Genial
  • Bernd: Hallo Benjamin, super Sache mit dem Auslesetool! Vielen Dank! Wünsche Dir einen guten Rutsch! ...

Letze Inhalte

What can go wrong on switching applicati ... 07.03.2012
WYSIWYG Editor for Markdown and reStruct ... 06.03.2012
Extending Heise SocialSharePrivacy to pa ... 07.12.2011
ReflectionException: Method PHPUnit_Fram ... 30.11.2011
Identifier "request_context" is not defi ... 08.11.2011
Netbeans, Symfony, Xdebug and the magica ... 08.11.2011
Automatic pushing to a remote git-reposi ... 08.11.2011
Logging Mails send via Zend_Mail with Ze ... 19.12.2010
Creating hidden dummy files in empty dir ... 19.12.2010
Creating your own git aliases based on y ... 19.12.2010

Feeds

  • Inhalte Feed (Alle Artikel)
  • Kommentar Feed

Statistik

  • Blogeinträge: 215
  • Kommentare: 440
  • Texte: 43
  • Tools: 11
  • Tags: 651
  • Codeschnipsel: 32
mehr Statistiken
Lizenzen:
Soweit nicht anders angegeben:
  • Codeschnipsel: New BSD license
  • Texte, Blogeinträge: CC BY-NC-SA
  • Photos / Bilder: Soweit nicht angegeben unter keine freien Lizenz!

Über den Author:

Photo Benjamin Steininger Benjamin Steininger ist Webentwickler auf der Suche nach einem neuen Job und photographiert sehr gerne. Er beschäftigt sich viel mit dem Internet, PHP, Symfony, Testing und hat einen Wunschzettel bei Amazon.
Profile: Ohloh, Github
, Coderwall

mehr Informationen über mich

Powered by

Zend Framework 1.10 / Doctrine 1.2 / ezComponents 2009.1.2 / Webalizer Extended / Piwik / Apache 2.2 / Lighttpd 1.4 / php 5.2 / mysql 5.1 / Debian / JQuery 1.4 / Syntaxhighlighter 2.1 / Blueprint CSS Framework / HTML Purifier 4 / ...
mehr Informationen zur Technik

Kontaktmöglichkeiten

  • Jabber: robo47@blub-blub.net
  • OTR: 9262263C 3024C0D5 B4EEA269 CFEDF021 D28CB980
  • Email: robo47@robo47.net
  • Skype: robo47
  • Twitter: robo47
  • Identi.ca: robo47
  • Kontaktformular