-
Notifications
You must be signed in to change notification settings - Fork 808
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
Twitter Timeline: fix Undefined index notice #6
Twitter Timeline: fix Undefined index notice #6
Conversation
tweet-limit was undefined in defaults Read more about the issue here: http://wordpress.org/support/topic/undefined-index-tweet-limit
Displaying it as Would it be better to default it to null, maybe? That would still get cast to |
See #6 for more details.
Why not just display 'no limit'? |
Displaying "No Limit" by default might be nice, but let's imagine the following scenario:
|
I see your point. I don't know how to explain this but I'll try: What would you say to a toggle option?
|
As per the Official Twitter Timeline documentation the If not provided, I'd sooner see it display as blank, rather than a number that could be misleading. So maybe add a sanitize snippet like |
Not all browsers support Also I agree with blank being better than 0. 0 is just confusing. |
If they don’t support number, it’ll just display as a normal text input. Nothing lost, and PHP can normalize the input on save. George Stephanis On December 18, 2013 at 2:41:43 PM, Alex Mills (notifications@github.com) wrote:
|
This reverts commit 2eedb2e.
Null is the default value (unlimited amount of tweets) Input now uses `number` type with `min` and `max` values as recommended in the twitter documentation: https://dev.twitter.com/docs/embedded-timelines See discussion in #6 for more details.
Looks good. |
Twitter Timeline `undefined index` & html5 input. Migrate the tweet-limit to use input type="number" and set a min and max of 1 and 20, respectively. Fix the undefined index by setting a default.
Summary: This MC page https://[private link]?tags=hello&sort=popularity&_locale=en&refresh=0 was failing with this error: ``` Fatal error: Uncaught Error: Call to undefined function has_meta() in /home/wpcom/public_html/public.api/rest/sal/class.json-api-post-base.php:123 Stack trace: #0 /home/wpcom/public_html/public.api/rest/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php(264): SAL_Post->get_metadata() #1 /home/wpcom/public_html/public.api/rest/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php(130): WPCOM_JSON_API_Post_v1_1_Endpoint->render_response_keys(Object(WPCOM_Post), 'display', Array) #2 /home/wpcom/public_html/public.api/rest/json-endpoints/class.wpcom-json-api-get-post-v1-1-endpoint.php(70): WPCOM_JSON_API_Post_v1_1_Endpoint->get_post_by('ID', 7265, 'display') #3 /home/wpcom/public_html/public.api/rest/wpcom-json-endpoints/class.wpcom-json-api-read-site-post-endpoint.php(35): WPCOM_JSON_API_Get_Post_v1_1_Endpoint->callback('/read/sites/%s/...', 131300129, 7265) #4 /home/wpcom/public_html/wp-content/lib/reader-site-post/class.wpcom-reader-site-post.php(23): WPCOM_JSON_API_Read_Site_Post_Endpoint->callback('/read/sites/%s/...', 131300129, 7265) #5 /home/wpcom/public_html/wp-content/rest-api-plugins/endpoints/read-tags-cards.php(214): WPCOM_Reader_Site_Post::get_site_post(131300129, 7265) #6 /home/wpcom/public_html/wp-content/rest-api-plugins/endpoints/read-tags-cards.php(180): WPCOM_REST_API_V2_Endpoint_Read_Tags_Cards->process_es_results(Array) #7 /home/missioncontrol/public_html/reader/mobile-endpoints/cards/index.php(95): WPCOM_REST_API_V2_Endpoint_Read_Tags_Cards->get_cards(Array) #8 {main} thrown in /home/wpcom/public_html/public.api/rest/sal/class.json-api-post-base.php on line 123 ``` Searching around, it seems that the `has_meta` function is defined not in `wp-includes/post.php` but rather in `wp-admin/includes/post.php` I am a bit skeptical of this change though, because it seems like it could be potentially breaking many things. Test Plan: Apply patch on sandbox and see that cards are properly working for: https://[private link]?tags=hello&sort=popularity&_locale=en&refresh=0 I feel like it needs a bunch more testing, but not sure exactly what. Will definitely need to make sure that it doesn't break other things. Reviewers: bluefuton, gibrown Reviewed By: gibrown Subscribers: vickikb, sodrowski, jsnmoon, gibrown Tags: #touches_jetpack_files Differential Revision: D53904-code This commit syncs r218377-wpcom.
Beta Testing List: allow more formatting with Markdown
* Dashboard restyling to align it with the Jetpack branding * Refactor a bunch of things to use and reuse the same wrappers for all views. Add notices. Add footer. Put fatal error into a warning notice. * Stylize all UI messages consistently * Refactor to render the main content first without outputting it, and save whether the link to the VaultPress online dashboard must be shown or not This data is luego used in the caller function that handles the general rendering * Introduce the Jetpack logo package and place it under the footer * Use the gray version of the Jetpack logo * Move notice styles to a new stylesheet so they have a consistent look throughout the wp admin. Add classes so the notices are moved by WP core below the heading * Add a prompt so user has to confirm that they want to reset VP options in database * Set correct alert level for notices * Fix issue where I reverted a condition to test and didn't put it back as it was. * Fix wrapper width on large screens. Make cards stack on small screens. * Link the Powered by Jetpack to the Jetpack dashboard if it exists or jetpack.com otherwise * Hide heading served remotely in certain UI messages * Fix offset layout when Jetpack is deactivated. This is because when JP is active there's a different class in the body than when it's inactive and VP stands on its own admin screen * Fix layout of top notice on mobile * Hide notices that are shown above the dashboard wrapper just like we do in Jetpack
* Readme: add PHP version requirement. * Standardize structure & move old changelogs to separate file * It makes things easier for translators, they don't need to focus on translating old strings. * It makes the current changelog stand out a bit more. * Update plugin version to Beta * Changelog: add #6 * Remove bug fix section We may not need it in this release * Add testing file
When using WP-Cli to run the event "wp_cache_full_preload_hook" causes the follow error > /webdir/bin/wp cron event run --due-now ``` PHP Fatal error: Uncaught Error: Call to undefined function wp_cache_debug() in /webdir/web/app/plugins/wp-super-cache/wp-cache.php:3163 Stack trace: #0 /webdir/web/wp/wp-includes/class-wp-hook.php(298): wp_cron_preload_cache() #1 /webdir/web/wp/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #2 /webdir/web/wp/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 phar:///webdir/bin/wp/php/commands/cron-event.php(284): do_action_ref_array('wp_cache_full_p...', Array) #4 phar:///webdir/bin/wp/php/commands/cron-event.php(255): Cron_Event_Command::run_event(Object(stdClass)) #5 [internal function]: Cron_Event_Command->run(Array, Array) #6 phar:///webdir/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67): call_user_func(Array, Array, Array) #7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array) #8 phar:///webdir/bin/wp/php/WP_CLI/Dispatcher/Subcommand.php(372): call_user_func(Objec in /webdir/web/app/plugins/wp-super-cache/wp-cache.php on line 3163 Fatal error: Uncaught Error: Call to undefined function wp_cache_debug() in /webdir/web/app/plugins/wp-super-cache/wp-cache.php:3163 Stack trace: #0 /webdir/web/wp/wp-includes/class-wp-hook.php(298): wp_cron_preload_cache() #1 /webdir/web/wp/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #2 /webdir/web/wp/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #3 phar:///webdir/bin/wp/php/commands/cron-event.php(284): do_action_ref_array('wp_cache_full_p...', Array) #4 phar:///webdir/bin/wp/php/commands/cron-event.php(255): Cron_Event_Command::run_event(Object(stdClass)) #5 [internal function]: Cron_Event_Command->run(Array, Array) #6 phar:///webdir/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php(67): call_user_func(Array, Array, Array) #7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array) #8 phar:///webdir/bin/wp/php/WP_CLI/Dispatcher/Subcommand.php(372): call_user_func(Objec in /webdir/web/app/plugins/wp-super-cache/wp-cache.php on line 3163 ``` This patch correct this based on deactivate/uninstall hooks which works on WP-Cli.
Remove PHP function that displays the icons in the svg format
tweet-limit
was undefined in defaultsRead more about the issue here:
http://wordpress.org/support/topic/undefined-index-tweet-limit