-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$this->ptable not available in the DataContainer class #2103
Conversation
Ah, there are data containers without a ptable. Maybe we should rather check for that in the |
Shouldn't the |
That is what I thought as well, however, there might be custom data containers that need the method. On the other hand, these custom data containers will probably extend from @Toflar So I move the |
I have implemented another fix in 76a01b1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only purge one level up, right? It won't purge tl_page
for content elements?
Good point! That is another issue indeed (not related to this change though). |
I guess we have not been traversing through all parent records, because |
No, the parent of the parent is not required to be loaded. This has been discussed before and it's all good the way it is, you just need to pass on the correct tags when tagging. |
That is not really possible (see the initial issue description). Unless you want to use |
I think overriding makes sense but imho the callback should be in the |
I still think it is wrong to have this method in the Can we not move the method to the |
If it doesn't work we can move it alltogether without a deprecation message. |
Moved in 115ecca. |
Removing the pid handling is correct because it's not necessary anyway. You should make sure as a developer to tag your response with all the used resources. |
But for new resources this is not possible as you cannot tag the news archive module with a cache-tag of a not-yet-existing news article. So IMO we have to make sure that creating new elements in a child table actually clears the cache for the parent table (one level up is enought here IMO). For modifications and deletions this should not be necessary I think. |
But as long as there is no news article, there will be no cached news reader page, either, will there? |
The idea would be to tag all elements working with news with the general |
Yeah we're invalidating the specific tag and the general one on every edit which kinda renders the specific one useless... |
I mean, it's okay imho if you don't tag the front end list element for example with |
Can we improve this somehow? E.g. by not invalidating the general tag? |
Not sure. Invalidating the general tag is kind of like "hey, something regarding the news changed" and maybe you want your response to be invalidated in that case because you don't know. Then we'd need a specific |
The news list module currently gets tagged with |
Why? The cache entry for the news list module will be purged if the |
If you add a new news article the list module on the website will not be tagged with this new |
But that's only "by chance". It only works if there is a parent table. If there's not, it wouldn't work. We need special handling for "create". |
Description ----------- | Q | A | -----------------| --- | Fixed issues | Fixes #2103 | Docs PR or issue | - Commits ------- d43984a Also invalidate the ptable cache tags in the DC_Table class 2bb2483 Fix the 'Declaration should be compatible' error ffa7d96 Revert the changes and only check isset($this->ptable)
In #2039, we have changed the
invalidateCacheTags()
method, which now accesses$this->ptable
. However,protected $ptable
is only declared in theDC_Table
class and not in theDataContainer
class.