GithubHelp home page GithubHelp logo

"An error has occurred." about camptix HOT 4 CLOSED

automattic avatar automattic commented on September 26, 2024
"An error has occurred."

from camptix.

Comments (4)

kovshenin avatar kovshenin commented on September 26, 2024

Hey there! Please make sure that you're entering the [camptix] shortcode on a Page (not a post or other post type) and as is, with no spaces, and no attributes: [camptix]. Disable all plugins and revert back to Twenty Ten, if you still get the error let me know.

A tech description of the above is the following. The shortcode doesn't operate by itself, it relies on a function hooked to template_redirect which executes before the shortcode content is shown. If it has not executed, the "An error has occurred." message is shown instead, meaning the $camptix->template_redirect() method is bailing, probably at the very beginning.

Let me know if you can provide me with more info. You can also reach me on Skype, I'm kovshenin.

Thanks!

from camptix.

jelison avatar jelison commented on September 26, 2024

Thanks for the super quick reply and info!

Looks like the culprit is the theme itself; switched back to Twenty Ten and things are working just fine... For the record, I'm using a premium theme. In particular, Viewpoint (http://themeforest.net/item/-viewpoint-responsive-single-page-portfolio/2793926) which converts things to a single page display. I guess things in the back end are creating the blocker to the necessary function.

I'm also guessing that there's no clear workaround for this that you'd know of without providing dedicated support for this theme's issue(s). And certainly, I'm not asking you to provide that. :)

If there's any general input/guesses on resolving a blocker like this related to the theme, I'm all ears. Otherwise, kudos again for the plugin (beautiful to setup and use [in Twenty Ten]), and a big thanks for the response.

from camptix.

jelison avatar jelison commented on September 26, 2024

Hey kovshenin, just wanted to follow up on this as I've uncovered a resolution.

I went back to the theme developer to discuss the possibility that his work was potentially creating a hurdle for the template_redirect function. After a test to ensure that it was not, which it appeared it in fact was not, he took a look at your plugin.

His advice to me was this:

Go to camptix.php and find:
if ( ! is_page() || ! stristr( $post->post_content, ‘[camptix]’ ) ) return;
remove it

This should’ve been done by the plugin developer as he developed it and he surely knew that it can only executed when in a page. Since this is a one-page theme, all the content was printed on the homepage.

I removed that from camptix.php and the plugin shortcode worked as expected – no more error code.

I'm not knowledgeable enough with php to understand what this correct, or what the actual issue was (or really, who the onus falls on), but I thought I'd pass it along in case it helps anyone else in the future.

Again, fantastic plugin. Thanks.

from camptix.

kovshenin avatar kovshenin commented on September 26, 2024

Hey @jelison, thanks for helping debug this! Removing that check will run the code on every page request during template_redirect, which is not the best solution. Also, I'm thinking to move away from shortcodes entirely, not sure how well this would work with single-page/ajax-powered themes. I do, however, think that the is_page check can be less strict, though I haven't tested the shortcode in posts or custom post types, which may also break things :)

Thanks again, and let me know if there's anything I can do to help you further!

from camptix.

Related Issues (20)

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.