Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php |
— | — | @@ -892,16 +892,21 @@ |
893 | 893 | // parse wiki-text |
894 | 894 | $output = $tmpParser->parse( $form_def, $title, $tmpParser->getOptions() ); |
895 | 895 | $form_def = $output->getText(); |
896 | | - $expiry = $output->getCacheExpiry(); |
897 | 896 | |
898 | 897 | // store in cache if allowed |
899 | 898 | if ( $sfgCacheFormDefinitions && $form_id !== null ) { |
900 | 899 | |
901 | | - if ( $expiry == 0 ) { |
| 900 | + if ( $output->getCacheTime() == -1 ) { |
902 | 901 | self::purgeCache( $form_article ); |
903 | 902 | wfDebug( "Caching disabled for form definition $cachekey\n" ); |
904 | 903 | } else { |
905 | | - self::getFormCache()->set( $cachekey, $form_def, $expiry ); |
| 904 | + |
| 905 | + if ( method_exists( $output, 'getCacheExpiry' ) ) { // MW 1.17+ |
| 906 | + self::getFormCache()->set( $cachekey, $form_def, $output->getCacheExpiry() ); |
| 907 | + } else { // MW 1.16 |
| 908 | + self::getFormCache()->set( $cachekey, $form_def ); |
| 909 | + } |
| 910 | + |
906 | 911 | wfDebug( "Cached form definition $cachekey\n" ); |
907 | 912 | } |
908 | 913 | |
— | — | @@ -968,10 +973,11 @@ |
969 | 974 | } else if ( is_null( $parser ) ) { |
970 | 975 | return wfMemcKey( 'ext.SemanticForms.formdefinition', $formId ); |
971 | 976 | } else { |
972 | | - if ( method_exists( 'ParserOptions', 'optionsHash' ) ) { |
| 977 | + |
| 978 | + if ( method_exists( 'ParserOptions', 'optionsHash' ) ) { // MW 1.17+ |
973 | 979 | $optionsHash = $parser->getOptions()->optionsHash( ParserOptions::legacyOptions() ); |
974 | | - } else { |
975 | | - $optionsHash = $parser->getOptions()->getUser()->getPageRenderingHash(); |
| 980 | + } else { // MW 1.16 |
| 981 | + $optionsHash = $parser->getOptions()->mUser->getPageRenderingHash(); |
976 | 982 | } |
977 | 983 | |
978 | 984 | return wfMemcKey( |