(FYI - as I was setting the project info this bug, I realized there was a flurry of releases in the past week and this might be fixed in the latest version.... if you're using this module and you're not ready to upgrade, this might yet be a solution for you.)
1. Go to node/add/filemaker
2. Provide "Title"
3. Set "FileMaker feature to use for default Drupal view" to "browse mode"
4 Click "Save"
You receive a blank content area, save for the following error message:
"Error #5 : Command is invalid (for example, a Set Field script step does not have a calculation specified)"
This is one of those annoying catch-all errors for the Filemaker PHP API, and might as well say "There's an error." Fortunately I was able to pin it down. When you create a new Filemaker node you're sent, as is default Drupal behavior, to hook_view(). In this modules case, it when going to the view page with tab type set to 'browse', there's no check for a layout. The module and the Filemaker API try to create a new FindCommand, which lacks a layout and the API request bombs. So, I recommend inserting a check for the layout, and if its not find, directing the user to the proper configuration form.
***************
*** 618,627 ****
--- 618,633 ----
* Displays a found set of FileMaker records and, optionally a form to edit a single FileMaker
* record, as well as all portals displaying data related to the record being edited.
*/
function filemaker_browse_tab($node, $tab = NULL, $fmid = NULL) {
+ // Can't browse without a layout.
+ if (empty($node->layout)) {
+ drupal_set_message('No layout set. You must set a layout before browsing', 'error', FALSE);
+ return drupal_get_form('filemaker_layout_form', $node);
+ }
+
// Normal Drupal node view. Need a found set.
if (empty($tab)) {
filemaker_default_find($node);
}
Comments
Comment #1
jyg commentedThis still bombs in 2.4 becauase I believe it was fixed in 2.2 in the wrong place or in the wrong way. I see that you're using "!$node->layout". You ought to use "empty($node->layout)"
Comment #2
jyg commentedMy bad, I have it in the wrong place too. It should be at the start of hook_view() to cover both bases. I see you've sort of tried to this, but it seems more difficult than it has to be. Am I missing something?
Comment #3
tedstein commentedPlease try version 3.0; I believe this to be fixed.
3.0 can also call FileMaker scripts with Drupal cron.
Comment #4
tedstein commentedComment #5
tedstein commentedI have tried to recreate this every possible way and believe I have solved this problem.
Please reopen if you can provide instructions to reproduce. Otherwise, I am assuming fixed.