You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The overlay feature in gallery format makes n number of requests for each image to the server to get the actual URL of the image in client side. This can be done in server side much easily using something like this:
$file = wfFindFile( $title );
if ( !$file || !$file->exists() ) {
returnnull;
}
// Default behavior: Use the direct link to the file.$url = $file->getUrl();
The $url can be passed to add() method as the third parameter.
/** * Add an image to the gallery. * * @param Title $title Title object of the image that is added to the gallery * @param string $html Additional HTML text to be shown. The name and size * of the image are always shown. * @param string $alt Alt text for the image * @param string $link Override image link (optional) * @param array $handlerOpts Array of options for image handler (aka page number) */function add( $title, $html = '', $alt = '', $link = '', $handlerOpts = [] ) {
I will be shortly testing this and if possible submit a fix. But just wanted to note this here so if anyone else comes across this finds it.
The text was updated successfully, but these errors were encountered:
kghbln
changed the title
Format overlay makes too many requests to get image link
Gallery format / Format overlay makes too many requests to get image link
Mar 1, 2017
I tested this and my analysis is correct that we are making a lot of unnecessary calls. But I am not sure how we want to proceed about this as we are also using the File:xyz.jpg link for the overlay icon.
Can someone using this feature or actively working on it suggest?
The overlay feature in gallery format makes n number of requests for each image to the server to get the actual URL of the image in client side. This can be done in server side much easily using something like this:
The $url can be passed to add() method as the third parameter.
I will be shortly testing this and if possible submit a fix. But just wanted to note this here so if anyone else comes across this finds it.
The text was updated successfully, but these errors were encountered: