Code Monkey home page Code Monkey logo

archivist's People

Contributors

flygenring avatar goldsky avatar happypelican avatar jako avatar josht avatar joshualuckers avatar jpdevries avatar matdave avatar mikrobi avatar muzzwood avatar sentience avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

archivist's Issues

Links generated by Archivist snippet causing Error 404 unless cache is cleared

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.

issue with Archivist & Babel in a multicontext setup

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.

Archivist 1.2.4 not working as of MODX 2.5.2 Update

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]]

Feature Request: Let getResources prefilter processed resources

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

Feature Request: Set active class for <li>

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.

Feature request: Add sortby TV to available options

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.

Blank output when at least one resource has restricted access

  1. Create 2 resources and publish them on the same month, under the same parent.
  2. Restrict access to one of these resources by putting it into a "member" resource group.

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.

[] operator not supported

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

Count error on Archivist snippet after PHP 7.2 update

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

Support for PHP 7.1.x

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 ?

Find a maintainer

Archivist needs a maintainer, as I no longer maintain it and apparently it hasn't been maintained since.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.