Skip to content
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

Field still uses direct DB queries #14

Open
michael-e opened this issue Sep 1, 2013 · 2 comments
Open

Field still uses direct DB queries #14

michael-e opened this issue Sep 1, 2013 · 2 comments

Comments

@michael-e
Copy link
Member

The Migration Guide for 2.3 for Extension Developers points out:

A new manager, PageManager provides an interface for the tbl_pages and tbl_page_types, it is recommended you use the manager instead of querying these tables (as they may not exist in the future)

The Pages Field still uses some queries to tbl_pages_types and one query to tbl_pages. I haven't looked at the new manager yet, so I don't really know if there is a chance to show "best practice" (a.k.a. "follow the recommendations") here. But if it is possible to use the PageManager, it should probably be done.

@designermonkey: What do you think?

@designermonkey
Copy link
Member

I did spot these queries. There are a lot of instances of use of the PageManager too, so I think these queries are odd ones out, but I'm happy to take a look soon to see if it can be cleaned up some more.

@nitriques
Copy link
Member

I do not know if this issue was fixed and not closed, but the only thing that is not using the PageManager is this one function fetchPageByTypes: https://github.com/symphonists/pagesfield/blob/master/fields/field.pages.php#L125-L187

PageManager::fetchPageByType only accepts one type and we need more. There are other filtering requirement that the PageManager does not cover.

Maybe we should consider moving fetchPageByTypes to the PageManager, but this is a separated issue.

I'll leave the issue open but I think it can be closed.

This was referenced Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants