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

Cater for noderef select fields which may have many entries #17

Open
bobbingwide opened this issue Feb 20, 2016 · 0 comments
Open

Cater for noderef select fields which may have many entries #17

bobbingwide opened this issue Feb 20, 2016 · 0 comments

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Feb 20, 2016

There is a limit to how many posts can be loaded when populating the select list for a noderef field. When there are thousands of nodes the #options array becomes quite unwieldly.
Also there is a distinct possibility that the server runs out of memory.

When editing an oik_hook post type ( part of the oik-shortcodes plugin ), the Fields metabox fails to display due to.

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16781312 bytes) in C:\apache\htdocs\wporg\wp-includes\functions.php on line 3464

This is because there are over 16K posts with post type of oik_api.

Ditto for any other post type that attempts to display a select field for a noderef of post type oik_api

Workaround

Exclude the fields from the Fields meta box by not registering its association to the post type.

Proposed solution

Implement a select2 like field or another solution that works with mega data.

Note: The logic to load a noderef field's values ( bw_load_noderef2() ) is actually part of the oik plugin.

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

1 participant