Add a "reasonable amount" or rows to your action log
Export the action log to CSV
A CSV is downloaded
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /Users/phil/Sites/joomla-cms/libraries/vendor/joomla/uri/src/UriHelper.php on line 40
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /Users/phil/Sites/joomla-cms/libraries/src/Session/Session.php on line 386
or
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /Users/phil/Sites/joomla-cms/libraries/vendor/joomla/registry/src/Registry.php on line 219
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /Users/phil/Sites/joomla-cms/libraries/src/Session/Session.php on line 386
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /Users/phil/Sites/joomla-cms/libraries/joomla/database/driver.php on line 1886
Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0
Labels |
Added:
?
|
One of my issues has a link to a large db for testing...
large db for testing...
http://screenshot.myjoom.la/3dd57411d692
username: admin password: admin (PLEASE CHANGE email address of "admin" user before mass spamming me ;-))
I can get that database to export on my system if I use a Generator (PHP 5.5+). Haven't stumbled on anything that's PHP 5.3 compatible yet though.
Just for reference so someone can come back to it later (this diff should be on top of #22750):
diff --git a/administrator/components/com_actionlogs/helpers/actionlogs.php b/administrator/components/com_actionlogs/helpers/actionlogs.php
index c384728914b..f6add337205 100644
--- a/administrator/components/com_actionlogs/helpers/actionlogs.php
+++ b/administrator/components/com_actionlogs/helpers/actionlogs.php
@@ -24,7 +24,7 @@ class ActionlogsHelper
*
* @param array|Traversable $data The logs data objects to be exported
*
- * @return array
+ * @return Generator
*
* @since 3.9.0
* @throws InvalidArgumentException
@@ -42,27 +42,24 @@ class ActionlogsHelper
);
}
- $rows = array();
-
// Header row
- $rows[] = array('Id', 'Message', 'Date', 'Extension', 'User', 'Ip');
+ yield array('Id', 'Message', 'Date', 'Extension', 'User', 'Ip');
foreach ($data as $log)
{
$extension = strtok($log->extension, '.');
+
static::loadTranslationFiles($extension);
- $row = array();
- $row['id'] = $log->id;
- $row['message'] = strip_tags(static::getHumanReadableLogMessage($log));
- $row['date'] = JHtml::_('date', $log->log_date, JText::_('DATE_FORMAT_LC6'));
- $row['extension'] = JText::_($extension);
- $row['name'] = $log->name;
- $row['ip_address'] = JText::_($log->ip_address);
-
- $rows[] = $row;
- }
- return $rows;
+ yield array(
+ 'id' => $log->id,
+ 'message' => strip_tags(static::getHumanReadableLogMessage($log)),
+ 'date' => (new JDate($log->log_date, new DateTimeZone('UTC')))->format('Y-m-d H:i:s T'),
+ 'extension' => JText::_($extension),
+ 'name' => $log->name,
+ 'ip_address' => JText::_($log->ip_address),
+ );
+ }
}
/**
@@ -157,6 +154,8 @@ class ActionlogsHelper
*/
public static function getHumanReadableLogMessage($log)
{
+ static $links = array();
+
$message = JText::_($log->message_language_key);
$messageData = json_decode($log->message, true);
@@ -174,7 +173,12 @@ class ActionlogsHelper
// Convert relative url to absolute url so that it is clickable in action logs notification email
if (StringHelper::strpos($value, 'index.php?') === 0)
{
- $value = JRoute::link('administrator', $value, false, $linkMode);
+ if (!isset($links[$value]))
+ {
+ $links[$value] = JRoute::link('administrator', $value, false, $linkMode);
+ }
+
+ $value = $links[$value];
}
$message = str_replace('{' . $key . '}', JText::_($value), $message);
Labels |
Added:
J3 Issue
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-02-10 21:34:30 |
Closed_By | ⇒ | PhilETaylor |
#22750 should help here, purposefully not closing until we get some confirmation that "a reasonable amount" of logs are efficiently handled here.