developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
39
results
Andrew Fletcher
•
Since upgrading to Drupal 9.3.0 have you come across this error?
Edit mediaTypeError
: Argument 1 passed to Drupal\Core\File\FileUrlGenerator::generateString() must be of the type string, null given, called in /app/web/sites/default/files/php/twig/61baa150bc5f6_media--document.html.twig_h9bK0We32VfjIKYeac5J1n4Mn/6wcKI-HiereIg8aXE0Znemy4PM0s6woj_Cr2Trl_U68.php on line 59 in
Drupal\Core\File\FileUrlGenerator->generateString()
(line 58 of...
Andrew Fletcher
•
When you have an entity ID value such as node ID (nid) or taxonomy term ID, how...
Andrew Fletcher
•
Creating a message log using Drupal watchdog.
Simple log
// Logs a...
Andrew Fletcher
•
Working in Twig, I had to add classes to a pre-existing array. Whilst I've...
Andrew Fletcher
•
Whilst working through an edit person view in a SwiftUI project, I experienced...
Andrew Fletcher
•
When managing a navigation title in Swift, you will have trodden down the path. Previously you have entered something like
.navigationTitle("Title")If you wanted to alter the font used for the navigation area, alter the init() in the view:
struct YourView: View {
// ... code ... //
init() {
// Use this if NavigationBarTitle is with large font
UINavigationBar.appearance().largeTitleTextAttributes = [.font : UIFont(name: "Georgia-Bold", size: 20)!]
}
...
Andrew Fletcher
•
Struggling to hide the SwiftUI separators in a List or Form?
The...
Andrew Fletcher
•
Core Data - customising our data model
When you are using Core Data, and let's...
Andrew Fletcher
•
In SwiftUI, has made creating a list of item very easy. If...
Andrew Fletcher
•
I attempted the run command and the response I had was succeeded, but then...
Andrew Fletcher
•
Working in Laravel, I needed to loop through an array and know whether the current loop was odd or even row. To do this add the expression to your Twig file:
{% set direction = loop.index0 is odd ? 'left' : 'right' %}In the call above, the variable direction is set to either left or right depending on the value of the position of the loop row (loop.index0). I then used the left or right value in a div class adding to a series of tailwind css definitions. Such...
Andrew Fletcher
•
Working with buttons
To begin, what is a button in SwiftUI?
struct MainView:...
Andrew Fletcher
•
When those simple annoyances are too frustrating! Yes we have all been...
Andrew Fletcher
•
To add ejabberd and run MYSQL to the server I needed to update the server...
Andrew Fletcher
•
The purple warning notification of annoyance recently came my way! I...