Skip to main content

Questions tagged [craft2]

Questions specific to the Craft 2 version of Craft CMS; avoid using for questions applicable to all or multiple versions.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Multiple Plugins Sharing the Same PHP Includes

Is it possible for multiple plugins in Craft 2 to share the same PHP Include file? If so, where would the shared file need to be located? Thanks
buck1112's user avatar
  • 400
1 vote
1 answer
41 views

Same File Shared By Multiple Plugins

I'm working in Craft 2, and was wondering if there is a way to share the same file among all of my plugins? Each of the plugins will be reading the same XML file, and, currently, I've only been able ...
buck1112's user avatar
  • 400
1 vote
1 answer
357 views

My site has been hacked. I have managed to clean it up. But now, most of my links are looping back to the home page

My site was hacked by a Russian hacker. I know because the characters were Russian on one of the files he left. I have cleaned up the site, but many of the links are looping back to the home page. ...
Alex Briones's user avatar
0 votes
0 answers
28 views

Limit External API Calls From Plugin In Craft 2

I have a plugin in Craft 2 that will make an API call to an external API to gather and display data on a template; however, I would like to limit the number of calls to a certain number per second (or ...
buck1112's user avatar
  • 400
0 votes
0 answers
52 views

Craft 2 - Referencing Twig Variables in Javascript - Variables Do Not Exist

I'm working with a template in Craft 2, and in referencing Twig variables in the Javascript, they are not recognized when the page is previewed. I get a Template Error - Variable x does not exist ...
buck1112's user avatar
  • 400
0 votes
2 answers
35 views

Craft 2 Caching RESTful API Results Displayed On Page

I have made a php plugin in Craft 2 which calls a RESTful API and displays the results on the template. The data is returned at about 8 seconds. I've surrounded the call to the plugin on the ...
buck1112's user avatar
  • 400
1 vote
2 answers
137 views

Element In Template Not Hiding On Page Load

I'm working on a template in Craft 2, and I have a number of divs which are part of a Javascript "read more" script, which automatically shortens the visible text at a set number of ...
buck1112's user avatar
  • 400
1 vote
1 answer
62 views

Craft CMS 2 - Exporting entity issue

I installed this https://github.com/boboldehampsink/export plugin but getting error during exporting entities regarding to "count(): Parameter must be an array or an object that implements ...
Nik Dev's user avatar
  • 13
1 vote
1 answer
84 views

Upgrade from craft 2 fails due to read-only mode

I'm trying to upgrade an old Site from Craft 2.9.x. The goal is to eventually upgrade to Craft 4.x, but I thought it would be easier to first update to Craft 3.x. When trying to Finish up my database, ...
Sandro's user avatar
  • 53
0 votes
1 answer
34 views

Pulling all entries

I'm having trouble trying to display all entries in my list. This code is working fine to grab the first entry. {% for entry in craft.entries.section('positions') %} <li class="list-item-...
Goodie's user avatar
  • 11
0 votes
0 answers
12 views

When clicking on a link under the title bar menu I get the error "postBodyCol2"

I have migrated a site from Cpanel to Plesk and when I click on one for the sub menus I get the error: When clicking on a link under the title bar menu I get the error: Internal Server Error Craft\...
QwertyOvBfd's user avatar
1 vote
1 answer
40 views

We updated our PHP from 7.2 to 7.4 and are now getting an "Internal Servor Error" when someone uses our Request a Quote form. Please help!

We updated our PHP from 7.2 to 7.4 and are now getting an "Internal Servor Error" when someone uses our Request a Quote form. Please help! We use Hubspot to send the leads to our email if ...
Roy's user avatar
  • 13
1 vote
1 answer
189 views

Set preferred language for new users in CP in craft 3

I have a customer who is admin and creates new users in the backend, so they can have access in the frontend (with this login they see more content than non-logged in users). After that, these new ...
Henrik's user avatar
  • 425
2 votes
1 answer
181 views

Admin account password doesn't work in local environment but does on live site

Working on a Craft 2 site and trying to login with the admin account. We can login to the live site without any problems but when trying to login to a dev environment (using DDEV) the password isn't ...
Jaytrix's user avatar
  • 337
1 vote
1 answer
53 views

Craft 2 Looping Through Assets Limit 100

In Craft 2, I am looping through Image Assets, but the loop stops after 100 images. I currently have around 140 images, but only the first 100 appear. Is this a built in limit in Craft 2? Thanks {% ...
buck1112's user avatar
  • 400
1 vote
0 answers
29 views

Craft 2 White Screen - All Queries Not Running

I have a CraftCMS 2 template with a JavaScript setTimeout for auto refresh, and quite randomly, the page will only display a white page. Dev mode is enabled, and, through the browser's inspector, in ...
buck1112's user avatar
  • 400
2 votes
1 answer
151 views

::model(), ::populateModel() and ::populateModels() in Craft 3

I'm attempting to port a custom plugin that was originally written for Craft 2. It has a fair bit of logic, controllers, services, records, models etc. The records and models which I admittedly don't ...
James White's user avatar
  • 1,171
0 votes
0 answers
46 views

Admin CP requests Http rather than https so browser gives non secure and javascript doesn't load

I have a weird issue happening and looking for any advice or tricks to try. I currently have an AWS setup for my site but I don't have control of aws as that is handled by a different internal ...
user1535268's user avatar
1 vote
0 answers
29 views

Craft 2 - Date Comparison In Criteria - Impossible to access an attribute ("today") on a string variable (">=")

I am working with a template in Craft 2, and I am setting up the criteria for entries to be displayed. Here is my code (below). {% set today = now|date('Y-m-d') %} {% set criteria = { section: '...
buck1112's user avatar
  • 400
1 vote
1 answer
231 views

Craft CMS SSL added to website correctly but says insecure for admin panel

I have 2 websites one in craft cms 2 and the other in craft cms 3. Everything works fine except the control panel always shows HTTPS insecure, for both the sites. Below is my .htacces file, <...
harshal jadhav's user avatar
1 vote
1 answer
342 views

Migrating Craft CMS 2 to 3

I have a craft CMS 2 codebase that a former developer had made for running on our PHP 5 server. Recently, the server upgraded its PHP version to 7.3 so I am trying to migrate the website to a later ...
Joseph D's user avatar
1 vote
1 answer
106 views

Class 'Craft\File' not found during installation

I'm installing Craft 2 locally and am getting this error message when I expect the installation screen. I've checked the write permissions, and the directory has them (inheritable permissions). ...
buck1112's user avatar
  • 400
0 votes
0 answers
20 views

How can I stop a user registration thank you page being cached in Craft 2

I seem to have an issue with a thank you page on user registration in craft 2. The thank you page gets passed a modified users id which is shown to the the registrant. However some odd occasions have ...
joomkit's user avatar
  • 2,034
1 vote
1 answer
258 views

Loading JavaScript on Template Load

I'm working on a kiosk-type plugin which will cycle through all news entries, beginning upon template (or page) load. It needs to load a JavaScript ajax script for this on page/template load. Would ...
buck1112's user avatar
  • 400
0 votes
0 answers
30 views

Adding A Soft Delete in Craft 2 Entries

I've been thinking of adding a "Soft Delete" or just perhaps a means in which deleting in certain sections (e.g. News) will archive the entry with an update, rather than deleting it. As I ...
buck1112's user avatar
  • 400
0 votes
0 answers
171 views

Internal Server Error after upgrading from craftcms 2 to 3

I just upgraded from Craft 2 to 3.6.14 (latest). I was able to successfully to the upgrade. I am able to get into the admin and was even able to install the feed-me plugin. I ported over all the files ...
Karthik N G's user avatar
1 vote
1 answer
140 views

Upload file issue on Craft 2.9.2

This issue is occurring on Craft 2.9.2. The assets are stored on Amazon AWS (S3). When I try to uploaded a new asset (of any size, even very small), the progress bar moves to 100% position but remains ...
inspirednz's user avatar
1 vote
1 answer
41 views

Import Plugin on localhost Craft 2 crashes

I'm using the import plugin by Bob Oldehampsink on a localhost Craft2 site, but, although it appears to have installed successfully, when I attempt to upload the .csv file and click on 'next,' I'm met ...
buck1112's user avatar
  • 400
1 vote
1 answer
339 views

Display list of assets that are in use?

I am very new to Craft and how it works. I've got a client with a Craft site (v2.9.2), that I help them with. It was created by another developer. I want to help them tidy up their Assets. There are ...
inspirednz's user avatar
7 votes
1 answer
818 views

Running Craft CMS 2 on MySQL 8.0+ (Any major considerations?)

Yes, that's not a typo. This is for a Craft 2 site (long story). Because MySQL 5.6 is EOL in a few weeks, I am validating how feasible it can be to run under MySQL 8.0, there's not really any option ...
James White's user avatar
  • 1,171
0 votes
0 answers
63 views

How to get a specific category by index

I have 4 level product categories. For the menu I am building I need to pick a second category in all top level categories So I get top level categories like so {% set lv1Categories = craft....
Lumiere's user avatar
  • 11
1 vote
2 answers
1k views

mkdir(): Permission denied

I have an old craft 2 installation. When I want to go to the frontend I get: mkdir(): Permission denied 745 { 746 if ($permissions == null) 747 { 748 $permissions = ...
KSPR's user avatar
  • 3,786
0 votes
0 answers
39 views

Why do image Transformations never finish rendering regardless if I use GD2 or ImageMagick?

I'm running Craft 2 with PHP 5.6.40 on a Windows 2019 Server under IIS (x64, non-thread-safe, FastCGI). PHP -m doesn't show any issues with my extensions, regardless if I use GD2 or ImageMagick. But ...
J.D.'s user avatar
  • 101
1 vote
1 answer
73 views

Admin panel not working without language code

I've migrated a website with CraftCms 2 from local to a pre-production server. Everything is working fine but, I don't know why, I only can go to the admin panel with locale code before /admin. I mean,...
Manuel González's user avatar
1 vote
1 answer
409 views

Send email notification to user's email when their entry has been enabled

Running craft 2 on a customer's site. They have users that sign up on the site to receive personalized quotes. What I'd like to do is send an email notification to that user after an admin has enabled ...
Noah Yamen's user avatar
1 vote
1 answer
259 views

German special characters like umlauts (ä, ö, ü) are not converted correctly with convertFilenamesToAscii

Filenames with German special characters are not converted correctly with convertFilenamesToAscii, e.g. ä, ö, ü are converted in a, o, u in contrast to ae, oe, ue in slugs with limitAutoSlugsToAscii.
Sanbo's user avatar
  • 129
1 vote
1 answer
38 views

Craft 2 new locale and dealing with root-relative links

Hi I am adding new locale which is jp and I have a huge problem with href tag. Our paragraph field have href links using relative link like this: <a href="/page_a"> page a</a> ...
Nelson Nguyen's user avatar
1 vote
1 answer
299 views

How I add security header on the front-end on Craft CMS

I have Mod_headers installed and active on my server, I know that Craft adds some headers from PHP but only for Control Panel requests. How can I add security headers to the front-end? Thank you
Azazel's user avatar
  • 101
1 vote
1 answer
38 views

Use locale not included in Craft

I have to develop a website under Craft CMS 2 and going to Locale Options I see I can add a language, but I need to use a language that is not included in the official codes for the representation of ...
Manuel González's user avatar
1 vote
1 answer
170 views

Users not fully deleting from the database

From the admin, if I delete a user they disappear from the admin list but not from the users database table. Looking through the code I can see UsersService.php has a function deleteUser which calls ...
Aravona's user avatar
  • 111
1 vote
1 answer
33 views

Craft 2: possible to control plugin triggering order?

I have a Craft site which has 2 different plugins listening to the same event (the Contact Form beforeSend event). The outcome is one is being triggered before the other and this is causing issues. Is ...
Cole Henley's user avatar
  • 1,741
1 vote
1 answer
413 views

Assets (in assets folder) failing to load locally [Craft 2]

I'm trying to get my Craft 2 site running locally again (it worked at one point but now does not). I have gotten all the db related issues (seemingly) done and dusted and the admin loads fine, but it ...
J. Ktz's user avatar
  • 21
1 vote
1 answer
551 views

How to filter entries with null value in date field?

I have date field in entry that is empty therefore has null value. I'd like to filter entries that have date field value equal to null. How would I set that parameter on element criteria object? I don'...
Dominik Krulak's user avatar
0 votes
1 answer
159 views

How get entries between mutiple dates, ordered by date?

I'll import (event) entries with feedme in craftcms 2 from an API who I'll can't change. The api gives the startdate off the events in a dateTime object. The allDay events have a date without time. ...
Maarten Heideman's user avatar
1 vote
1 answer
4k views

Checking which version of Craft CMS a site is using

I've been asked to look at Craft CMS site where my would-be client has been ghosted by his previous developer. I have no handover information and only FTP and phpmyadmin access presently. Looking ...
steve's user avatar
  • 131
0 votes
1 answer
99 views

How do I upgrade the MYSQL database from Craft 2 to Craft 3 on GoDaddy

How do I upgrade my MySQL DB for a Craft 2 site to Craft 3. I don't have access to the SSH server or use of Composer, so I have to move files via FTP and do everything manually. My client is on ...
Aric Harris's user avatar
1 vote
1 answer
209 views

Craft Internal Server Error

I am getting the following error: Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #34 of SELECT list is not in ...
MikeeeG's user avatar
  • 131
0 votes
1 answer
94 views

Using action as a key in a query string

I've been tasked with recreating an API within our Craft 2.X installation. For whatever reason, the API specifies the resource it is requesting with the query string parameter action. For example, ...
Erik G's user avatar
  • 103
1 vote
1 answer
437 views

Implement hreflang with multi sites

I currently have multi site config. One site have 2 locales. My configuration like so: 'example.com' => array( 'siteUrl' => array( 'us_en' => 'https://www.example.com/', '...
Nelson Nguyen's user avatar
1 vote
1 answer
363 views

How to create an entry with MySQL?

I'm trying to create a new entry from within the database. The section is defined in craft_sections, and the entries for craft_elements, and craft_entries seem correct after the script is run, but no ...
ponies's user avatar
  • 387