- This topic has 6 replies, 3 voices, and was last updated 5 years, 6 months ago by
cully.
-
AuthorPosts
-
-
July 28, 2016 at 5:02 pm #7050
cullyParticipantI have an admin page for some settings. At the top of the page, I get this error:
Notice: Undefined index: layout in plugins/piklist/includes/class-piklist-workflow.php on line 594. I’m getting the same error on a number of different project, though I’m using basically the same setup as below. Does this mean I’ve left something out, or do you think it’s a bug?My admin page setup looks like:
add_filter('piklist_admin_pages', function ($pages) { $pages []= [ 'page_title' => 'Filter Settings', 'menu_title' => 'Filter Settings', 'capability' => 'manage_options', 'menu_slug' => 'of_settings', 'setting' => 'of_settings', 'menu_icon' => WordPress::assetUrl("assets/images/filters-16x16.png"), 'page_icon' => WordPress::assetUrl("assets/images/filters-32x32.png"), 'single_line' => true, 'default_tab' => 'General', 'save_text' => 'Save Settings', ]; return $pages; });I have a few tabs. The settings file headers look like:
my_plugin/parts/settings/general.php:
/* Title: General Tab: General Tab Order: 100 Setting: of_settings Order: 20 */my_plugin/parts/settings/sort.php:
/* Title: Sorting Tab: Sorting Tab Order: 300 Setting: of_settings Order: 20 */ -
August 1, 2016 at 7:38 pm #7065
jrcreativeMember@cully I’m not seeing the files under /workflows
I think that might be your missing piece. I know I overlooked them the first time I created workflows. 🙂
check out the docs: https://piklist.com/learn/doc/building-first-workflow/
-
August 1, 2016 at 8:27 pm #7066
cullyParticipant@jrcreative I don’t have a workflow, but I was under the impression you don’t need to explicitly define one for a settings page. Everything works fine without one, I just get that
Notice. In production those notices are turned off, so I don’t see them and everything works the way it should. -
August 3, 2016 at 9:03 pm #7075
-
August 4, 2016 at 4:06 pm #7082
cullyParticipant@Steve Is that the case if I only want tabs? It seems to work great without defining a workflow, except I get that notice. Would a possible solution be to just check if that key isset before using it in
class-piklist-workflow.php? -
August 5, 2016 at 10:22 am #7087
-
August 5, 2016 at 5:11 pm #7100
cullyParticipantAdding a workflow got rid of the error. Thanks!
-
-
AuthorPosts
- The topic ‘Undefined index: layout’ is closed to new replies.