contao/core — pull request #5192 by tristanlins (2012-12-30 09:10:05+00:00)
Title: CRITICAL protect tl_content from deletion

The backwards compatibility delete `tl_content` records where `tl_content.ptable == ''`, even if I delete a parent record from another table than `tl_article`.

To clarify the situation, a short example:

The table `tl_article`:
```
id | title ...
1 | I'm an article ...
```

The table `tl_news`:
```
id | title ...
1 | I'm an awesome news ...
```

The table `tl_content`:
```
id | pid | ptable | type ...
1 | 1 | | text ... // belongs to tl_article !!!
1 | 1 | tl_news | text ... // belongs to tl_news !!!
```

If I now delete the `tl_news` record `id=1`, the backwards compatibility will select:
`SELECT id FROM tl_content WHERE pid=? AND (ptable='tl_news' OR ptable='')`.
This will also select the `tl_content` records, that belongs to `tl_article`!
The backwards compatibility should only be used for `tl_content` records which belongs to `tl_article`!