modxcms / archivist Goto Github PK
View Code? Open in Web Editor NEWThis project forked from splittingred/archivist
Archive-based navigation for Resources.
Home Page: https://modx.com/extras/package/archivist
This project forked from splittingred/archivist
Archive-based navigation for Resources.
Home Page: https://modx.com/extras/package/archivist
I’ve been having a strange issue with the Archivist extra on Revo 2.5.8, specifically, the Archivist snippet that generates the Month/Year links to filter resources by.
In this particular installation, I have a multi context setup;
The generated links work for about 15 minutes, after this time they generate a page not found message when clicked, unless I clear the site cache, where they work again.
There are errors in my site log related to this issue…
Error 1
2017-08-22 14:53:54] (ERROR @ /paas/cXXXX/www/core/cache/includes/elements/modplugin/31.include.cache.php : 50) PHP warning: array_search() expects parameter 2 to be array, null given
Inside 31.include.cache.php / the block of code that contains line 50. Line 50 relates to this:
$alias = array_search($archiveId,$modx->aliasMap);
/* get resource to redirect to */
$resourceId = false;
$prefix = 'arc_';
foreach ($archiveIds as $archive) {
$archive = explode(':',$archive);
$archiveId = $archive[0];
$alias = array_search($archiveId,$modx->aliasMap);
if ($alias && strpos($search,$alias) !== false) {
$search = str_replace($alias,'',$search);
$resourceId = $archiveId;
if (isset($archive[1])) $prefix = $archive[1];
}
}
Error 2
[2017-08-22 14:53:55] (ERROR @ /paas/cXXXX/www/core/model/modx/modx.class.php : 1006) PHP warning: array_key_exists() expects parameter 2 to be array, null given
Inside modx.class.php / the block of code that contains line 1006 is:
if ($useAliasMap) {
if (isset($this->context) && $this->context->get('key') === $context && array_key_exists($uri, $this->aliasMap)) {
$resourceId = (integer) $this->aliasMap[$uri];
} elseif ($ctx = $this->getContext($context)) {
$useAliasMap = $ctx->getOption('cache_alias_map', false) && array_key_exists($uri, $ctx->aliasMap);
if ($useAliasMap && array_key_exists($uri, $ctx->aliasMap)) {
$resourceId = (integer) $ctx->aliasMap[$uri];
}
}
}
When I clear the site cache (which makes Archivist work again), when I view the contents of context.cache.php I can see the aliasMap array with URL's and ID's. When it stops working, the aliasMap is no longer present in context.cache.php.
Any help in troubleshooting would be much appreciated.
I'm using Archivist 1.2.4 / Xrouting 1.4.1 / Babel 3.0.0 in a multicontext setup with MODX 2.5.8.
When I click on a Archivist link such as /archive/2017/09/
and try and switch the language, babel reports the link to be /archive/?arc_year=2017&arc_month=09
even thought friendly URLs are switched on within MODX and Archivist.
The parameters in the url are causing a problem with my site caching (and generating 404's).
Could this be a problem with Archivist or Babel ? I'm not quite sure. Apologies if it's not a problem with Archivist.
Perhaps it could check if pdoTools is installed, if not check for getResources.
In the frontend the Archivist snippet is not outputting anything and no errors are being written to the MODX error log.
[[Archivist? &target=
[[*archivePageID]] &parents=
[[*id]],[[*pressespiegelID]] &useFurls=
0]]
I think it would be a good idea to use getResources to filter the list of resources processed by archivist. This adds &tvFilters to the available options.
Example: Only display Posts belonging to the "Musings" category.
&tvFilers=`Category==Musings`
I have a functional proof of concept in my gists: https://gist.github.com/pepebe/991362dc0ff355b5ef69
If this concept is worth adding to the archivist package, I can do a pull request.
Regards,
pepebe
Would be nice to be able to set a active class like you can do with Wayfinder.
For example: &activeCls=´active´ renders to < li class="active" >
Then one could style the active Link.
Today I stumbled upon an old forum post by tsnekifox: http://forums.modx.com/thread/81834/sortbytv-for-archivist
Would adding the ability to sort by a date TV be something easily done for Archivist? ... in cases where you want to do an archive for an event list instead of a blog I think it would be helpful to be able to sort by a TV for the event date as apposed to the publish date.
I think this is a very good idea and it should be added to a future version of archivist.
Regards,
pepebe
P.S. I posted a dirty workaround to this problem in the thread. Anyone with a similar problem should have a look for it.
Create a resource and embed the Archivist snippet. Logged in "members" will see the snippet output, logged out visitors will see nothing whereas one of the 2 resources is accessible to everybody.
I was able to fix this by editing the snippet source code, replacing getIterator (line 136) with getCollection. But I'm not sure if it's the correct way to do it.
Hi,
I've upgraded my site to MODX 2.5.7 and moved it to a new web server with PHP 7.1. Now I get the below error when using Archivist 1.2.4-pl. Is it due to incompatibility with PHP 7 and is there a quick way of solving it?
Thanks!
Fatal error: Uncaught Error: [] operator not supported for strings in /var/www/vhosts/mydomain.com/httpdocs/core/cache/includes/elements/modsnippet/2.include.cache.php:60 Stack trace: #0 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modscript.class.php(70): include() #1 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modparser.class.php(521): modScript->process() #2 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modparser.class.php(250): modParser->processTag(Array, true) #3 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modresponse.class.php(69): modParser->processElementTags('', '<!DOCTYPE html ...', true, false, '[[', ']]', Array, 9) #4 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modrequest.class.php(137): modResponse->outputContent(Array) #5 /var/www/vhosts/mydomain.com/httpdocs/core/model/modx/modx.class.php(1146): modRequest->prepareResponse() #6 /var/www/vhosts/mydomain.com/httpdocs/core/cache/includes/elements/modplugin/1.include.cache.php(76): modX->sendForwar in /var/www/vhosts/mydomain.com/httpdocs/core/cache/includes/elements/modsnippet/2.include.cache.php on line 60
Line 142: $count = count($resources);
Seems to not be getting the object that it is supposed to be getting. I yields this error:
count(): parameter must be an array or an object that implements countable
It seems that the issue appears when using PHP 7.2
We are using MODX 7.0 and PHP Version 7.2.19
I've just upgraded a server from PHP 5.6.x to PHP 7.1.
When I click on links generated by Archivist, i'm getting an Error 500 - can anybody confirm compatibility ?
Archivist needs a maintainer, as I no longer maintain it and apparently it hasn't been maintained since.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.