SilverStripe Swipestripe - swipestripe-gallery module error - silverstripe

I've installed Swipestripe module. and added swipestripe-gallery module for product images.
when I did dev/bulid?flush=1 it shows error Class 'Gallery_PageExtension' does not exists
I have seen gallery.yml file in swipestripe-gallery/_config folder, which has
Product:
extensions:
- 'Gallery_PageExtension'
but this class is not there in Product.php file in swipestripe-gallery/code folder.
After commenting above code I did dev/build?flush=1 & there was no error. But in product page the Gallery tab is not added.
Please Help.

You didn't install using composer? Your fault ;) It installs all requirements for you and you can code happy.
See https://github.com/swipestripe/silverstripe-swipestripe-gallery#requirements, you'll need to install https://github.com/frankmullenger/silverstripe-gallery for getting this gallery extension in your codebase.
I strongly encourage you to install ALL modules with composer. It may be a bit hard in the beginning, but in some days your life will be much more comfortable! A good introduction can be found in the ss docs.

Swipestripe's config does not have that code: https://github.com/swipestripe/silverstripe-swipestripe/blob/2.1/_config/swipestripe.yaml
The gallery module for it does: https://github.com/swipestripe/silverstripe-swipestripe-gallery/blob/1.1/_config/gallery.yml
These are two separate modules. If the gallery file is in swipestripe/_config as you say, then it would seem to me that the install didn't happen as it should.
There should be two folders in your installation root
swipestripe/
swipestripe-gallery/
All files relating to each module should be in each (individual) folder. It seems you're missing the swipestripe-gallery folder all together, meaning that the class in fact does not exist (When you get this error, just check that the class exists somewhere in your install. Using grep is the easiest way).

Related

Change the location of the node_modules folder

I'm currently trying to migrate an old ASP.NET WebSite project to Visual Studio 2015. I'd like to use NPM/Gulp to automatically compile LESS files to CSS (this task was done by WebEssentials in VS 2013).
I added a package.json file to the project to load the required components. This creates a node_modules folder in the root of the WebSite project, and this is where my problem starts:
Since WebSite projects don't have a project file, all files (and sub-directories) found in the project root folder, are automatically part of the project. Due to the deeply nested directory structure inside node_modules, this leads to errors because of too long path names.
An easy workaround is to set the hidden attribute on the node_modules folder (but this has to be done manually by each developer).
Is there a way to tell NPM to put the node modules into another directory e.g. one level above the project (..\node_modules) where the solution file is?
Or is it possible to set the hidden attribute on a folder from a gulp-task (which runs when the project is loaded)?
Based on #Rik's answer, I was able to solve the problem:
Instead of adding the package.json and gulpfile.js into the WebSite project, I added them at the solution level (as solution items). This means, that the node_modules folder is now in the solution directory at the same level as the WebSite project(s).
The only other change was to modify the paths in gulpfile.js accordingly.
You might want to check out npm 3.0+. It installs the modules in a maximally flat structure. It should reduce the paths lengths in the module directory.
From the release notes
Flat, flat, flat!
Your dependencies will now be installed maximally flat. Insofar as is
possible, all of your dependencies, and their dependencies, and THEIR
dependencies will be installed in your project's node_modules folder
with no nesting. You'll only see modules nested underneath one another
when two (or more) modules have conflicting dependencies.
#3697 This will hopefully eliminate most cases where windows users ended up with paths that were too long for Explorer and other
standard tools to deal with.
#6912 (#4761 #4037) This also means that your installs will be deduped from the start.
#5827 This deduping even extends to git deps.
#6936 (#5698) Various commands are dedupe aware now.
This has some implications for the behavior of other commands:
npm uninstall removes any dependencies of the module that you specified that aren't required by any other module. Previously, it
would only remove those that happened to be installed under it,
resulting in left over cruft if you'd ever deduped.
npm ls now shows you your dependency tree organized around what requires what, rather than where those modules are on disk.
#6937 npm dedupe now flattens the tree in addition to deduping.
https://github.com/npm/npm/releases/tag/v3.0.0
For upgrading the windows installation check out this package npm-windows-upgrade

BitBucket doesn't import "wp" folder from WordPress-Skeleton

Im trying for the first time to use Bitbucket togheter with SourceTree when building a WordPress site. Where working in a group of six people so I would really like to use the power of these services.
Right now im following this guide when trying to accomplish this:
https://www.youtube.com/watch?v=gx_XfziaHvo
I've also looked at several other guides and all of them say that i should base my WordPress site on markjaquith's WordPress-Skeleton base.
https://github.com/markjaquith/WordPress-Skeleton
The problem I've encountered is that when i start my Respository on BitBucket it does not import the folder "wp". Everything else is included but the folder "wp". Therefore I can't install WordPress. It's missing a massive amount of vital files.
After searching the internet and stackoverflow i can't seem to find a solution or any one else with the same problem! What am I doing wrong?
I've also tried importing the WordPress-Skeleton git directly in SourceTree but no luck there either.
... you'll have to add the wp folder to track it.
Use this: git add --all
$ git add --all
Next, use: git status (and you should see the wp folder and all new changes are added and being tracked)
$ git status
This is a silly question, but did you check your .gitignore file?

Django CMS - Template Does Not Exist Error while creating first page

I followed the instructions for installing Django CMS on my mac. When I run "manage.py cms check", everything is fine, except it says it cannot find the template_1.html. When I go into the admin to create a page, the template is in the Template drop down. When I try to save the page it gives me "TemplateDoesNotExist at /admin/cms/page/add/".
Maybe it's noteworthy, I was having issues with the url prior to this error. I was not able to open the admin or even get main page to render in the browser. After searching stack overflow I found the same issue. I changed the url patterns from the "urlpatterns = i18n_patterns" to the standard. That worked. Now I have this issue. Any assistance would be appreciated. Thanks.
Link to Traceback if needed:
http://dpaste.com/hold/1430437/
I had the same error (on Ubuntu 12.04)
Following the django-cms 2.4.3 installation instruction,
django-admin.py startproject myproject
creates a directory myproject (in which manage.py resides) and a subdirectory, also named myproject, which contains the setting files and the templates directory.
I don't know if this is the intention of the authors of the django-cms doc. But the instruction
os.path.join(PROJECT_PATH, "templates"),
in the TEMPLATE_DIRS setting points to /absolute/path/to/myproject/templates.
This should be changed to:
os.path.join(PROJECT_PATH, "myproject/templates"),
to point to the correct directory /absolute/path/to/myproject/myproject/templates

Qt How to make and install plugins?

I would like to use the Qt Quick Components for Desktop mentioned here: http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/
The author gives the following installation-instructions:
Since all of this is developed as a plugin to Qt itself, all you need to get started is the Qt 4.7.2 SDK. Just check out the http://qt.gitorious.org/qt-components/desktop and do the equivalent of a qmake && make install on your system.
I cloned the repository, executed qmake, mingw32-make and mingw32-make install on it in the command-line.
A new folder was created which includes the files libstyleplugin.a and styleplugin.dll.
I just don't know what to do with them. The sample-qml-files (using the components I try to install here) show nothing in the QML-Viewer, which means they aren't isntalled correctly.
So what am I supposed to do? (btw. I'm on Windows).
Hedge, I've done that on Linux but I believe you will be able to do the same on Windows. You already built the plugin which is good. Cause it seems "make install" doesn't really work (lets not blame the trolls - its just an experimental project), you need to do that manually. Now you need to do the following:
Create "imports" directory inside the directory whether you installed Qt.
Create "Qt/labs" directory inside that "imports" directory so overall it looks like this: YOUR_QT_DIR/imports/Qt/labs.
Copy "components" directory from the director where you built the components to "YOUR_QT_DIR/imports/Qt/labs" so it looks like this: YOUR_QT_DIR/imports/Qt/labs/components.
Go to "examples" directory in the directory where you built the components. You will find Browser.qml, Gallery.qml and Panel.qml files there. Open say Gallery.qml in a text editor and replace the following two lines on the top:
import "../components"
import "../components/plugin"
with
import Qt.labs.components 1.0
save changes and run Gallery.qml in qmlviewer. You should be able to run it.
Also you could leave the import statements from Gallery.qml as they were but that would rely on the relative directory where you built the components and won't work anywhere else.
Hope that helps
On Windows my directory ended up being C:\QtSDK\Desktop\Qt\4.7.3\mingw.
Hope this helps!

After upgrading Wordpress, I get a fatal error "Call to undefined function require_wp_db()"

I followed instruction as mentioned in Wordpress, but I still got the error and referred Google and I was shocked to see many blog have same problem and they are not fixed yet and those blogs are indexed in Google, please try searching "Call to undefined function require_wp_db()" or find here
Google search result
Any advice how to fix? Thanks in advance
This will occasionally occur if you do not upload wp-config.php or all of the other files that have changed between versions.
Download a clean copy of the WP version you are trying to upgrade from the WP Release Archive.
Update wp-config.php with your database details, secret keys, etc.
Delete all files except for /wp-content on your server (hopefully you have kept all of your custom enhancements relegated to the /wp-content/themes directory as they recommend - otherwise you will have to diff against each individual file unless you've kept good track of your changes).
Upload all of the clean files except for the /wp-content directory
Run /wp-admin/upgrade.php
This question might have been misplaced on this site, but the cause of this error could be a general programming bumble.
Your problem could stem from ambiguous include paths. When using include / require / include_once / etc... if the filepath is not absolute, the file that gets included might not be the one intended. Read why here. To fix an ambiguous include directive, prefix the relative path with dirname(__FILE__).'/'.
A plugin or even your theme could be the culprit. A regex like this could help you find cases of this: (include|require)(\_once)?\s*\(?\s['"][^\/]
Example
I had a Wordpress theme for a multisite install that included a file like so:
require_once('sites.php'); Because sites.php was a file in the same directory, (and because the server's include path included "." -- the current directory), it worked.
However, because sites.php also existed at /wp-admin/network/sites.php, so this line caused the following error when trying to access the network dashboard:
Fatal error: Call to undefined function _get_list_table() in /www/OCE/WEBEDITOR2/wp-admin/network/sites.php on line 19
After trying the instructions in the other answer to no avail, I fixed my problem by finding and changing this line to:
require_once( dirname(__FILE__).'/sites.php' );
Note: In most, cases, Mark's suggested solution should be employed first in trying to fix this error after upgrading Wordpress, if only to eliminate other possible issues.

Resources