# Thu, Sep 16

alex-mashin added a comment to T287941: Create {{#get_program_data:}}.

BTW, are we going to document the new function?

# Sat, Sep 4

Also, now you can try to use |offset=, if you know how many lines of comments there are.

alex-mashin updated the task description for T290377: Add some automatic tests to ExternalData.
alex-mashin updated the task description for T290377: Add some automatic tests to ExternalData.

An example of directory walker used to build a class inheritance diagram is at the end of this set of examples.

# Wed, Sep 1

Those are better, but I think "offset" and "limit" would be better choices - the meaning of "end" is very unclear, and "offset" and "limit" are very standard terms (and a standard approach) for getting a subset.

# Tue, Aug 31

Can parsing of data be avoided for JSON and XML files?

I have some ideas.

Alright. If the goal is to handle all formats, maybe the parameters should be made more generic, like with "limit=" and "offset=" parameters?

The patch 715644 is useful only for CSV files.

# Aug 27 2021

alex-mashin added a comment to T287941: Create {{#get_program_data:}}.

Also, the current wording for "externaldata-xml-error" ("Error: XML $1 at line$2.") seems strange.

throw new EDParserException( 'externaldata-xml-error',
xml_error_string( xml_get_error_code( $xml_parser ) ), xml_get_current_line_number($xml_parser )
);

$1 is the complete error message from XML parser, which can be anything,$2 is the line number. There is nothing to add to it.

alex-mashin added a comment to T287941: Create {{#get_program_data:}}.

As for the error messages - my understanding is that core MediaWiki's error displays involve both the word "Error" and the "error" CSS class.

alex-mashin added a comment to T287941: Create {{#get_program_data:}}.

Okay, thank you for these explanations. I guess I thought functions like edfWikilinks4dot() were just the "tip of the iceberg" for what you wanted to add to External Data, but now I see that this is pretty much it, as far as data visualization.

Yes, that's it. Although, I think, I should remove the edf prefix, since the functions are not global.

alex-mashin added a comment to T287941: Create {{#get_program_data:}}.

Still, the whole visualization thing is not quite just a side-effect of #get_program_data, because you have added to the code at least two utility functions that help to process GraphViz and SVG data.

Those functions (EDConnectorExe::edfWikilinks4dot and EDConnectorExe::edfInnerXML) are not critical to the functionality; they are there only to make setting $edgExePreprocess and$edgExePostprocess in LocalSettings.php easier for the wiki admin.

# Aug 26 2021

alex-mashin added a comment to T287941: Create {{#get_program_data:}}.

My concern was just about the part of the patch that handles visualizations

It's only the short EDParserFunctions::doExternalValueRaw that implements the <external> tag and $parser->setHook( 'external', [ 'EDParserFunctions', 'doExternalValueRaw' ] );. You don't even need to document it; or you can make it off by default (e.g.,$edgExeRawTag = false;).

alex-mashin added a comment to T287941: Create {{#get_program_data:}}.

Flex Diargams is an interesting extension, too, though its concept is very different from {{#get_program_data:}}. I will consider adding software used by that extension as new examples to {{#get_program_data:}}. I am not sure that the opposite can be easily done, though. Interactive editing is a magnificent feature, although not so relevant, when diagrams are produced from SMW queries or other external data, which is the use case that I am accustomed to (in my next commit, there is an example of automatically drawn class inheritance diagram for ExternalData).

# Aug 25 2021

alex-mashin renamed T289644: Enable {{#get_web_data:}} and {{#get_file_data:}} to skip a number of initial and final lines from Enable {{#get_web_data:}} and {{#get_file_data:}} to skip a number of initial lines to Enable {{#get_web_data:}} and {{#get_file_data:}} to skip a number of initial and final lines.
alex-mashin renamed T287941: Create {{#get_program_data:}} from Create {{#get_exe_data:}} to Create {{#get_program_data:}}.
alex-mashin renamed T289614: Create two-level cache for slow/volatile {{#get_*_data:}} functions from Create two-level cache for slow/volatile {{#get_*_functions:}} to Create two-level cache for slow/volatile {{#get_*_data:}} functions.

# Aug 24 2021

alex-mashin renamed T289613: mw.ext.externalData.get* functions should be able to return hierarchical data from mw.ext.externalData.get* function should be able to return hierarchical data to mw.ext.externalData.get* functions should be able to return hierarchical data.

# Aug 23 2021

alex-mashin updated the task description for T287941: Create {{#get_program_data:}}.

# Aug 22 2021

alex-mashin added a comment to T289238: PageForms throws an exception.

I think this bug was already fixed at some point.

# Aug 19 2021

alex-mashin updated the task description for T289238: PageForms throws an exception.
alex-mashin updated the task description for T289238: PageForms throws an exception.
alex-mashin updated the task description for T289238: PageForms throws an exception.

# Aug 15 2021

alex-mashin added a comment to T256509: Remove BaseTemplateToolbox hook.

It seems that this hook is already gone from MediaWiki 1.35, in spite of being documented as deprecated. The extension PerformanceInspector does not work under PHP 1.35.3 because PerformanceInspectorHooks::onBaseTemplateToolbox is never called, despite having "BaseTemplateToolbox": [ "PerformanceInspectorHooks::onBaseTemplateToolbox" ], in extension.json.

It seems that this hook is already gone from MediaWiki 1.35, in spite of being documented as deprecated. The extension PerformanceInspector does not work under PHP 1.35.3 because PerformanceInspectorHooks::onBaseTemplateToolbox is never called, despite having "BaseTemplateToolbox": [ "PerformanceInspectorHooks::onBaseTemplateToolbox" ], in extension.json.

# Aug 6 2021

alex-mashin added a comment to T288188: Allow extra MathJax packages.

See my comment in T288189.

This is a different task: not only to change the server-side MathJax configuration, but also to make needed MathJax modules available to mathoid.

alex-mashin added a comment to T288189: User-defined macros.

Client-side MathJax was removed years ago.

Oh, that's why I couldn't get it working.

# Aug 3 2021

alex-mashin added a comment to T287942: Can't retrieve data from field with table alias.

Can you reproduce undesired behaviour on this database?

alex-mashin updated the task description for T287941: Create {{#get_program_data:}}.
alex-mashin updated the task description for T287937: Enable importing data from Microsoft Excel files in ExternalData.

# Aug 2 2021

You should use {{#display_external_table:}} with a template:

 ERROR! NOERROR!

}}

Closing due to long inactivity.

Closing due to absence of examples and clarification.

# Aug 1 2021

alex-mashin updated the task description for T287328: Allow use of prepared SQL statements in {{#get_db_data:}}.

# Jul 28 2021

What if the admin put in something like "DELETE * FROM Table" into the prepared statement - would the code check against that? Or is it assumed that an admin would not sabotage his own system?

Yes, this is the assumption. Anyone with access to PHP code and database credentials can send a DROP query, even without ExternalData extension.

Sorry for the delay. I don't understand the last thing you wrote: "arbitrary SQL queries are effectively disallowed". Would this change remove support for the standard #get_db_data approach?

If LocalSettings.php defines one or more prepared statements for a database connection, then for that connection only those prepared statements can be invoked by {{#get_db_data:}}, and any other queries will not be allowed for them. For such connections, the task of writing SQL queries is transferred to the MediaWiki server administrator.

# Jul 24 2021

alex-mashin updated the task description for T287328: Allow use of prepared SQL statements in {{#get_db_data:}}.
alex-mashin updated the task description for T287328: Allow use of prepared SQL statements in {{#get_db_data:}}.

# Jul 21 2021

alex-mashin updated the task description for T287101: Enable {{#get_db_data:}} to connect to MS SQL Server.

# Apr 16 2021

No, only the user themselves can do that by logging into Phabricator via their mw.org/SUL account and removing their LDAP account from their Phab account at https://phabricator.wikimedia.org/settings/panel/external/

I have removed the only LDAP external account from my (Alex Mashin) Phabricator account.

# Apr 15 2021

I confirm the request and thank @Kizule for the trouble he took.

# Apr 10 2021

alex-mashin renamed T279814: ValidGlobalNameSniff assumes that allowed global variable name prefix always consists of two characters from ValidGlobalNameSniff assumes that allowed global variable name prefix alway consists of two characters to ValidGlobalNameSniff assumes that allowed global variable name prefix always consists of two characters.

# Apr 9 2021

Parameter 'default xmlns prefix' is added to be used as default prefix for xmlns when no prefix is provided in the XML.

We are having this problem on https://lokalhistoriewiki.no/ after upgrading from 1.31 to 1.35.1. The PHP version is 7.4.16. Any idea how to fix it?

Try purging the browser cache and cookies.