silverstripe / silverstripe-lessons-v4 Goto Github PK
View Code? Open in Web Editor NEWThe source code for the SilverStripe.org Lessons section, version 4.x
License: Other
The source code for the SilverStripe.org Lessons section, version 4.x
License: Other
It may not be the query (13 rows with the provided database), but the iteration of it's results.
It seems that maybe while($record = $result->nextRecord())
may no longer do as expected, and in any case take far too long to do it's work, reaching the timeout of 30 seconds before the requested page can be rendered.
Below is an example, although the code is modified to demonstrate the issue:
Fatal error: Maximum execution time of 30 seconds exceeded in /usr/local/var/www/ss4/mysite/code/ArticleHolder.php on line 58
[Alert] Maximum execution time of 30 seconds exceeded
GET /ss4/travel-guides/
Line 58 in /usr/local/var/www/ss4/mysite/code/ArticleHolder.php
Source
49 ->setSelect([])
50 ->selectField("DATE_FORMAT(`Date`,'%Y_%M_%m')", "DateString")
51 ->setFrom($tableName)
52 ->setOrderBy("DateString", "ASC")
53 ->setDistinct(true);
54 $result = $query->execute();
55 //die($query->sql());
56 if ($result) {
57 $c=0;
*58 while($thing = $result->nextRecord()) {
59 $c++;
60 }
61 die("$c");
62 while ($record = $result->nextRecord()) {
63 list($year, $monthName, $monthNumber) = explode('_', $record['DateString']);
64 $list->push(ArrayData::create([
Trace
(no trace).
The die
is never hit. When commenting the loop, it is.
missing property photos
At end of lesson-05 try adding a new page that is a child of "Travel Guides".
At "Choose Page Type" 'Article Holder' is available but 'Article Page' is greyed out.
https://www.silverstripe.org/learn/lessons/v4/working-with-files-and-images-1
"On ArticlePage.ss, the photo is larger, and it's important that we show all of its content, since this is the detail view. Let's use SetWidth(750) for this one."
SetWidth(750) -> ScaleWidth(750)
And maybe it would be a good idea to mention that SetWidth was the old #ss3 method.
Thanks and Cheese! :)
"The images/ and javascript/ folders can be named anything you like"
Requirements::themedJavascript will look in /javascript according to http://api.silverstripe.org/en/master/class-SilverStripe.View.Requirements.html#_themedJavascript
Related Issue: silverstripe/silverstripe-framework#8640
https://www.silverstripe.org/learn/lessons/v4/introduction-to-frontend-forms-1 still quotes this non existent method.
Although technically not directly related to this repository...
Currently there's a bit of confusion, particularly if someone new to the system googles and receives a link directly to vimeo. It's not clear that e.g. the _ss_enviornment.php
file is not for the version they are probably trying to use (latest stable: ie. SS4).
If we could prefix the video names with e.g. ss3-
or something similar (does vimeo support tags?) this could help relieve confusion.
Perhaps also adding a blurb at the top of the description for each video that links off to the latest stable release equivalent would also be more ideal.
Instructions on this page Lesson Content say to run "composer install" in each "lesson-begin" directory.
However running composer install (or composer update) fails to load dependencies & install completely and creates errors when running in browser... it appears that the composer file settings are significantly out of date - Running "composer install" says it's out of date... then running "composer update" writes to the composer.json file to include the old "mysite" + "mysite/code" directories under "extra -> project-files-installed" ... even thou the silverstripe/lessons git repo's folder structure has already been changed from mysite to app (the composer file appears to create a mysite directory and write to the composer.json file)
This creates an error when trying to run silverstripe-lessons in the browser...
Fatal error: Uncaught Exception: There are two files containing the "Page" class: "C:\www\silverstripe-lessons-v4\Lesson-04-begin/app/src/Page.php" and "C:\www\silverstripe-lessons-v4\Lesson-04-begin/mysite/code/Page.php"
These lessons are an amazing learning resource - please update them so we can continue to enjoy learning SS.
In lesson 00 we describe how to set up a Silverstripe instance:
https://www.silverstripe.org/learn/lessons/v4/up-and-running-setting-up-a-local-silverstripe-dev-environment-1
In the Creating a Silverstripe project section the lesson uses the installer wizard. The installer wizard was removed in Silverstripe 4.5.0 and moved to it's own module. These instructions will not work.
Lesson 00 needs to be updated either to also install the installer wizard module, or to remove the description of the installer wizard and instead get the user to set up a .env at that stage.
This issue was brought up on Stackoverflow by a new user following the lessons for the first time.
The index.php file in the root of the lessons appears to be out of date.
Is it from SS3? The last line require_once 'framework/main.php'; fails. That is not where framework is anymore
These lessons are really out of date. Setting up the dev environment didn't go as per lesson 0 (the installer has been removed since the lesson was written) and now I'm stuck on the Working with multiple templates lesson due to an issue with namespaces.
Please could we get some up-to-date lessons with the latest version???
Is it just me or are these lesson out of date?
So I was browsing the PR and Issues here and noticed a few people had issues with the results section of the ArchiveDates() section on ArticleHolder.
silverstripe-lessons-v4/Lesson-20-end/app/src/ArticleHolder.php
Lines 45 to 78 in 924c117
I've tried a fix, even reverted to the initial configuration and are still having an issue. The problem seems to be around this one function as if I comment it out, and undo changes it said, I'm working again (Lesson 19).
PHP 7.2.2 using XAMPP.
Windows 7 Professional.
In lesson 09 it says "As described in a previous tutorial, the $owns
array is used to ensure that when regions are saved..." but I cannot find that previous tutorial using search engines.
@dnsl48 commented on Tue Feb 05 2019
4
Some suggestions to improve the lessons and the documentation on https://silverstripe.org
Lesson 0
is not the one which we work on in Lesson 1
<?php
tagsmysite/code/
folder instead of mysite/src/
static/article-holder.html
and static/article-page.html
are actually in __assets
folderimage resampling functions
$Image.FixMax(width, height)
- typo, should be FitMax
Code Repository __assets
folder$comment = ArticleComment::create($data)
rather than assigning each field separatelyhandleComment
on ArticlePage.php
instead of ArticlePageController.php
(a typo)_app/config/app.yml
does not exist, it's app/_config/app.yml
app/src/Property.php
snippet doesn't have peculiarity ->setEmptyString()
. It appears below in the next one.$Photo.SetWidth(750)
does not work. Should be ScaleWidth
(typo)use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
in the snippet where we update the Region's getCMSFields methodsidebar
with the simple theme concealed the Regions section and it wouldn't appear. May be confusing for beginners.MetaTags(false) + title
bit could be irrelevant as it comes with the theme in the Lesson 0supported versions
link is broken@robbieaverill commented on Tue Feb 05 2019
I've adjusted the impact rating since these are documentation issues.
Also FYI, the lessons issues could be tracked on the https://github.com/silverstripe/silverstripe-lessons-v4 repository if we want to move them out of framework
On the website markdown-tags inside of html-blocks aren't rendered.
silverstripe-lessons-v4/__tutorials/Lesson-00.md
Lines 161 to 163 in 4c37713
This issue can be solved by either not using markdown-syntax inside of HTML-elements or by using a markdown-engine which supports Markdown-syntax inside of HTML.
In Kramdown, for example, you can use markdown-language inside of HTML-elements by adding a markdown="1"
-attribute to the HTML-tag:
### Warning
<div class="alert alert-danger" markdown="1">
Markdown is **supported** inside this html-tag!
</div>
'themes' folder is missing from every lessons like in the below mentioned url,
https://github.com/silverstripe/silverstripe-lessons-v4/tree/master/Lesson-02-end
I see that silverstripe have recently changed the folders structure of this repo , if you working on theme folder, just ignore this post.
https://docs.silverstripe.org/en/4/lessons/ points to non-existant URLs. That's bad for two reasons: Devs need to hunt down the right page, and any SEO juice we've gotten on the old URLs will be gone. Can you please fix this, @unclecheese
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.