Note that there are some explanatory texts on larger screens.

plurals
  1. PODoctrine problematical on prod, but not dev
    primarykey
    data
    text
    <p>I earlier tested Symfony's web app on both local computer and target host in both environments: prod and dev - both worked fine. So I finished a mile stone on my local computer, still testing only on dev. Everything works fine. However - Doctrine seems to not working on prod now - and I don't know why and how it stopped working.</p> <p>Here's what I see - this code (from DefaultController.php) is working on both, prod and dev:</p> <pre><code> $tags = $this-&gt;getDoctrine() -&gt;getRepository("MyWebBundle:Tag"); </code></pre> <p>But this (one line more) is working only on dev, but not prod:</p> <pre><code> $tags = $this-&gt;getDoctrine() -&gt;getRepository("MyWebBundle:Tag") -&gt;find(1); </code></pre> <p>In prod the last line causes "die" to the webpage. There's no doubt that an error occured, but I have no any message in log, and of course in prod env Symfony is silent. I have no idea how to approach this problem... The most weird thing is that prod worked earlier properly.</p> <p>UPDATED: Ok, I traced the part of code which makes a difference of working and not working (but in prod, in dev always works). There are some relations in database (Tag Many-to-One to Category). Here is this part of code in Entity/Tag.php:</p> <pre><code>/** * @ORM\ManyToOne(targetEntity="Category") * @ORM\JoinColumn(name="id_category", referencedColumnName="id_category", nullable=true) */ protected $category; </code></pre> <p>It's interesting that Symfony2 is not verbose about it... When I delete it from Tag.php, my webapp works. If I re-type it into this file, it doesn't...</p> <p>UPDATED: After further research I can see that actually all relations are problematical (in prod, not in dev). I wrote additional "artificial" (for test purposes) queries to database - in a fashion as above, and all give one of two effects: <strong>When table is on top of hierarchical dependencies, everything works (let's call it A type)</strong> *<em>When table has relations, Symfony just stop working without any message (let's call it B type...</em>*</p> <p>I also tried to make a test with empty table and with fulfilled one. Two cases are following in "B-type" tables: <strong>When empty, it works</strong> *<em>When data are stored (with relations), it doesn't work</em>*</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload