fireproofsocks
Forum Replies Created
-
Forum: Plugins
In reply to: [Custom Content Type Manager] single post not showingDisabling permalinks is the easiest way to troubleshoot this. Environment issues are the hardest to troubleshoot… it’s important to figure out why the solution worked in one environment and failed in another.
Forum: Plugins
In reply to: [Custom Content Type Manager] Choose Image shows PHP errorWhich version of the plugin are you using? Specifically, I’d need the info that the CCTM generates when you click on the “Report a Bug” link (see https://code.google.com/p/wordpress-custom-content-type-manager/wiki/ReportingBugs)
Forum: Plugins
In reply to: [Custom Content Type Manager] single post not showingHmm… maybe the problem is environment related? E.g. were there edits in the .htaccess file or was there some redirect plugin installed in one environment and not in the other?
Yes: the url should dictate the post-type and post being queried, but WP’s mechanisms for this are massively confusing and inefficient and subject to change without notice (thus the broken functionality with the CCTM and WP 3.8)
Forum: Plugins
In reply to: [Custom Content Type Manager] Problem after moving serverBy “config” I mean your post-type definitions (i.e. the CCTM configuration). That’s what got toasted when you migrated servers (due to WP’s bad architecture).
This isn’t polished or documented yet, but here’s what you can do:
1. Re-recreate your post-types. You can look at the CCTM–>Info tab (/wp-admin/admin.php?page=cctm&a=info) to see a list of the post-types that were detected in your database and use that as a “shopping” list. E.g. you’ll see the standard post and page, but you should also see your custom ones, e.g. “myposttype” etc). Jot these down and then head to the CCTM-> Content Types -> Create Content Type page and recreate the custom post-types one by one. The most important thing is the “post_type” field: that’s what uniquely identifies the posts in the database. The other settings control aesthetics and behavior.
Once you’ve re-defined your post types, you’ll have menus and basic functionality back.
2. Re-create your custom fields. Go to CCTM –> Custom Fields –> Bulk Add fields. This is a helper utility that detects fields used by a given post or post type. E.g. choose one of your newly re-defined post types and then click “Lookup Fields”. As long as some data is in the database for this post-type, the CCTM can find the name of the field. It takes a guess as the label and then you can select the type of field (it defaults to a text field).
You can repeat step 2 for each post-type you’ve got and by the end you should have all your fields back. This isn’t a perfect recovery mechanism: meta data (such as search criteria or field types or custom labels etc) all has to be re-created. That’s the stuff that got lost when your config was nuked.
The get_custom_post and print_custom_fields functions are designed specifically to get info about the current post, i.e. the one currently in context.
If you want to query data on another post, then a different approach is needed, namely one that queries the database for the other posts and loops over the results. For retrieving info on one specific post, there is this convenience function: get_post_complete https://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_post_complete
For more complex queries there is the GetPostsQuery class and its get_posts function: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_posts
Or you are free to use any built-in WordPress function to query the database and return the info you want.
Keep in mind that relationships between posts are typically one way, so your scenario of having a current post show information about posts that have extra data is a bit trickier — the info you need is contained in the posts with the fields.
Depending on how you’ve structured your relationships, this function might be useful to you: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_incoming_links If post A defines a relation to post B, get_incoming_links allows post B to see who linked to it.
Hope that helps.
Forum: Plugins
In reply to: [Custom Content Type Manager] 404-error calling costum content typesI’m working on the solution. It’s this bug:
https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=534For now, use Mike’s hack.
Forum: Plugins
In reply to: [Custom Content Type Manager] Problem after moving serverIt’s tough – WP is really not built with moving in mind, unfortunately.
The good news is that your posts and values are there if you ported the database correctly. The bad news is that your definitions are toasted. There is a tool (under CCTM -> Tools) menu that will help you detect existing post types and custom fields. You can use that to help rebuild your config file. You’ll have to polish the custom field definitions (e.g. default values or options in a dropdown etc), but it can save you a lot of time.
Hope that helps.
Forum: Plugins
In reply to: [Custom Content Type Manager] single post not showingSounds like it’s related to this: https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=534
If you change the permalink settings, does the issue persist?
Forum: Plugins
In reply to: [Custom Content Type Manager] single post not showingOk, if you can provide more details then someone might be able to help.
Forum: Plugins
In reply to: [Custom Content Type Manager] single post not showingNot sure if I can help troubleshoot “messed up” — it’s not specific and it does not qualify as an error unless there is an actual PHP error going on (in which case that should be posted).
Keep in mind that templates are completely separate from the CCTM. I’ve tried to show examples of simple templates demonstrating how to retrieve and format custom data, but each custom data model requires a custom template to format it. An automated solution for templates really isn’t possible when the data is varied, but unfortunately WP templating is rather confusing once you deviate off the beaten path of posts and pages.
Forum: Plugins
In reply to: [Custom Content Type Manager] Not compatible OptionTree?Conflicts between plugins/themes is easily the #1 problem with using WordPress: it has no centralized logging mechanism and it is over-dependent on events for its architecture, so catastrophic collisions are common and hard to avoid. I don’t know anything about this “OptionTree” plugin. But the overall problem with WP is that it relies entirely on events to extend its functionality, so if the OptionTree plugin hooked something to the edit-page functionality, it could come into conflict with the CCTM, and because WP has no logging, you would never be the wiser and troubleshooting it quickly becomes an exercise in futility. The only way to avoid this type of thing is to disable the conflicting plugins. Either disable the CCTM or disable the OptionTree. If the problematic behavior ceases, then you’ve identified the problem source.
You can turn off the sub-menus for settings and custom fields by checking/unchecking the appropriate preferences under the CCTM’s global settings tab. That will hide the “Custom Fields” and “Settings” sub-menu for each custom content type. However, it’s not possible (or recommended) to disable the CCTM menu entirely. You can restrict it to only admin users by following the guidelines here: https://code.google.com/p/wordpress-custom-content-type-manager/wiki/Config_admin_menu
You can play with the wp-content/uploads/cctm/config/menus/admin_menu.php file.
Glad that worked. Changing environments is a big change as far as code is considered. And WordPress is not really written to be ported between environments. Your local include path will vary between servers, so it’s not at all surprising if the code worked in one environment and failed in another.
What errors are you getting?
You may need to require the class:
require_once CCTM_PATH.'/includes/GetPostsQuery.php';The CCTM manages its dependencies while in the manager, but if you’re trying to use a function/class in the front-end, it does not assume you need it, so it’s not loaded automatically.
No, relations are not defined bi-directionally — that’s pretty rare. I only know of one framework that supports bi-directional relation definitions.
There are, however, ways to lookup relations from the “other side”. E.g. https://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_incoming_links