duncanmcclean / guest-entries Goto Github PK
View Code? Open in Web Editor NEWAllow users to create, update & delete entries from the front-end of your site
Home Page: https://statamic.com/guest-entries
License: Other
Allow users to create, update & delete entries from the front-end of your site
Home Page: https://statamic.com/guest-entries
License: Other
With the previous update on allowing submission of replicator pictures, the pictures can be submitted.
However, when I try to edit the record without editing that replicator pictures field and do a submission again, pictures disappeared.
Statamic 3.3.51 Pro
Laravel 8.83.23
PHP 8.1.13
cc/guest-entries-support dev-main
doublethreedigital/guest-entries 2.0.1
jonassiewertsen/statamic-live-search 1.5.1
jonassiewertsen/statamic-livewire 2.9.0
mitydigital/sitemapamic 2.3.3
statamic/eloquent-driver 0.3.0
swiftmade/statamic-clear-assets 1.1.0
takepart-media/statamic-oreos 1.2.0
Hey, when I try to upload an image there is shown this error:
Impossible to create the root directory
"D:\website\public\assets\D:/website/public/assets/veranstaltungen"
D:\website\vendor\league\flysystem\src\Adapter\Local.php:112
*/
protected function ensureDirectory($root)
{
if ( ! is_dir($root)) {
$umask = umask(0);
if ( ! @mkdir($root, $this->permissionMap['dir']['public'], true)) {
$mkdirError = error_get_last();
}
umask($umask);
clearstatcache(false, $root);
if ( ! is_dir($root)) {
$errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : '';
throw new Exception(sprintf('Impossible to create the root directory "%s". %s', $root, $errorMessage));
}
}
}
/**
* @inheritdoc
*/
public function has($path)
{
$location = $this->applyPathPrefix($path);
return file_exists($location);
}
/**
No response
Statamic 3.2.5 Pro
Laravel 8.61.0
PHP 7.4.4
doublethreedigital/guest-entries 1.0.4
I can't get the error_redirect
parameter to work. I've tried:
.
Environment
Application Name: Stichting Lutje Geluk
Laravel Version: 10.8.0
PHP Version: 8.2.3
Composer Version: 2.2.7
Environment: local
Debug Mode: ENABLED
URL: lutjegeluk.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: database
Statamic
Addons: 6
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: dev-master PRO
Statamic Addons
doublethreedigital/guest-entries: 2.1.2
statamic/eloquent-driver: 1.2.0
studio1902/statamic-peak-browser-appearance: 2.0-beta.2
studio1902/statamic-peak-commands: 2.0-beta.3
studio1902/statamic-peak-seo: 2.0-beta.2
studio1902/statamic-peak-tools: 3.0-beta.2
I am using the Guest Entires to do a front end submission of form. However, when the submission is done, the picture uploaded are not showing in the collection entry. After some troubleshoot, it seems to be the Redis cache is not refreshing the Gallery.
If I am using file cache, this is not happening.
If I dont use a cache, this is not happening.
Licensing
SITE
No site license key
CORE
Statamic Pro 3.3.34 Unlicensed
ADDONS
Guest Entries 1.2.1 Unlicensed
Live Search 1.5.1
Livewire 2.9.0
Oreos 1.2.0
UNLISTED ADDONS
Guest Entries Support dev-main
Eloquent Driver 0.3.0
I have a assets field for images. Guests should be able to upload multiple images to this field. When I save from the cp are the image paths are saved like this:
images:
- path/filename.jpg
- path/filename.jpg
- path/filename.jpg
These are my input fields:
<input class="w-full" type="file" name="images[0]" accept="image/png, image/jpeg">
<input class="w-full" type="file" name="images[1]" accept="image/png, image/jpeg">
<input class="w-full" type="file" name="images[2]" accept="image/png, image/jpeg">
I've tried it with value too:
<input class="w-full" type="file" name="images[0][value]" accept="image/png, image/jpeg">
<input class="w-full" type="file" name="images[1][value]" accept="image/png, image/jpeg">
<input class="w-full" type="file" name="images[2][value]" accept="image/png, image/jpeg">
This error is shown:
Error
Call to a member function store() on array
domain.tld/!/guest-entries/create
event(new GuestEntryDeleted($entry));
return $this->withSuccess($request);
}
protected function uploadFile(string $key, Field $field, Request $request)
{
if (! isset($field->config()['container'])) {
throw new AssetContainerNotFoundSpecified("Please specify an asset container on your [{$key}] field, in order for file uploads to work.");
}
/** @var \Statamic\Assets\AssetContainer $assetContainer */
$assetContainer = AssetContainer::findByHandle($field->config()['container']);
$path = '/' . $request->file($key)
->store(
isset($field->config()['folder'])
? $field->config()['folder']
: $assetContainer->diskPath(),
$assetContainer->diskHandle()
);
if (isset($field->config()['max_items']) && $field->config()['max_items'] > 1) {
return [str_replace($assetContainer->diskPath(), '', $path)];
}
return str_replace($assetContainer->diskPath(), '', $path);
}
protected function honeypotPassed(Request $request): ?bool
{
Some other thoughts to the file upload. What will happen, when a guest uploads a file with an existing name or the same file multiple times? Do they overwrite the old file from an other guest? Perhaps they should get a timestamp in the filename or something. Or is it possible to change the save path from the files? This would be great, because when all guest save into the same directory, this could be really confusing, if you have a lot of entries. It would be great to have influence and add something like {{ year }}/{{month}}/{{slug}}
to the save path. Perhaps it's possible to add a param to the input, like <input data-path="{{ year }}/{{month}}/{{slug}}">
.
No response
Statamic 3.2.5 Pro
Laravel 8.61.0
PHP 7.4.4
doublethreedigital/guest-entries 1.0.5
As per title.
N/A
Nice to have
When a guest edits the entry, the changes should not shown directly public. At first the moderator should be able take a look on it and publish the changes after it.
Nope
This is sort of a blocker for me/this project.
I tried installing this last night using composer require duncanmcclean/guest-entries
and got this error.
I think it is trying to install an old version that wouldn't work with v4?
Install fresh, blank statamic and try to install addon with composer require duncanmcclean/guest-entries
New statamic 4 with nothing changed.
I list taxonomy entries in a multiple select field. When I choose the entries, they are saved correctly in the collection entry, but at the same time there are new entries generated in the taxonomy list.
<select name="eigenschaften[]" multiple>
{{ taxonomy from="eigenschaften" }}
<option value="{{ id }}">{{ title }}</option>
{{ /taxonomy }}
</select>
<select name="eigenschaften[]" multiple>
{{ taxonomy from="eigenschaften" }}
<option value="term1">Term1</option>
<option value="term2">Term2</option>
<option value="term2">Term2</option>
{{ /taxonomy }}
</select>
New entries created:
Statamic 3.2.2 Pro
Laravel 8.58.0
PHP 7.4.4
doublethreedigital/guest-entries 1.0.2
When you have a login form that redirects after success to a page with a guest entry form, the following code will execute:
{{ if {session:has key="success"} }}
{{ partial:components/notification type="success" content="Good job" }}
{{ /if }}
This makes it seem like the user submitted the form already.
.
Environment
Application Name: Stichting Lutje Geluk
Laravel Version: 10.8.0
PHP Version: 8.2.3
Composer Version: 2.2.7
Environment: local
Debug Mode: ENABLED
URL: lutjegeluk.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: database
Statamic
Addons: 6
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: dev-master PRO
Statamic Addons
doublethreedigital/guest-entries: 2.1.2
statamic/eloquent-driver: 1.2.0
studio1902/statamic-peak-browser-appearance: 2.0-beta.2
studio1902/statamic-peak-commands: 2.0-beta.3
studio1902/statamic-peak-seo: 2.0-beta.2
studio1902/statamic-peak-tools: 3.0-beta.2
Hi Guest Entries,
We are trying to upload files according to the setup here.
https://statamic.com/addons/double-three-digital/guest-entries/docs
And I have specified an assets field pointing to the assets Container.
After upload, I expect it goes to /var/www/html/public/assets.
However, it goes to /var/www/html/public/assets/var/www/html/public/assets.
It just simply take the public assets folder as the root and create folders.
/var/www/html/public/assets
inside the original Assests directory.Statamic 3.3.9 Pro
Laravel 8.78.1
PHP 8.1.5
doublethreedigital/guest-entries 1.2.0
The default antlers seems not to work and there is nothing about it in the docs.
No response
Statamic 3.2.1 Pro
Laravel 8.57.0
PHP 7.4.4
doublethreedigital/duplicator 1.3.4
doublethreedigital/guest-entries 1.0.1
{{ guest-entries:success }}
should probably be only true on the next page request. Currently when you've submitted one entry you get the succes notification on every page where you accept guest entreis.
Use guest-entries:success
Add an entry
Continue browsing/refreshing - notification won't clear
Environment
Application Name: Stichting Lutje Geluk
Laravel Version: 10.13.5
PHP Version: 8.2.3
Composer Version: 2.2.7
Environment: local
Debug Mode: ENABLED
URL: lutjegeluk.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: database
Statamic
Addons: 6
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.8.0 PRO
Statamic Addons
duncanmcclean/guest-entries: 3.1.0
statamic/eloquent-driver: 2.2.0
studio1902/statamic-peak-browser-appearance: 3.1.1
studio1902/statamic-peak-commands: 2.1
studio1902/statamic-peak-seo: 2.3
studio1902/statamic-peak-tools: 3.2
Whoops - forgot to do it before launch.
I am using Guest Entries addon. I see that I can following the guideline here to use replicator (https://guest-entries.duncanmcclean.com/examples/using-with-replicator).
My case is I am having a file upload element inside a replicator that requires multiple file uploads. How should I do that?
I am using this line of code.
<input class="form-control" type="file" name="rich_text_and_image[0][gallery[]]" multiple="">
But after the form submission, I go to the collection and cannot find any images being uploaded.
<!--
rich_text_and_image is the handle of the replicator
gallery is the file upload element handle
-->
<input class="form-control" type="file" name="rich_text_and_image[0][gallery[]]" multiple="">
Statamic 3.3.51 Pro
Laravel 8.83.23
PHP 8.1.13
cc/guest-entries-support dev-main
doublethreedigital/guest-entries 1.2.2
jonassiewertsen/statamic-live-search 1.5.1
jonassiewertsen/statamic-livewire 2.9.0
mitydigital/sitemapamic 2.3.3
statamic/eloquent-driver 0.3.0
swiftmade/statamic-clear-assets 1.1.0
takepart-media/statamic-oreos 1.2.0
Hey, I have some questions about deleting entries, if it's ok?
{{ guest-entries:delete collection="articles" :ids="ids" }}
Don't think so.
Will need it in the next few weeks
Currently, this addon doesn't support multi-site setups. It should generate the entry in the locale/site the user is currently in.
Do it yourself with a listener.
Nice to have
{{ if {session:has key="success"} }}
<p>You've filled in the thing properly. Good job!</p>
{{ /if }}
This code should work but doesn't.
Environment
Application Name: Stichting Lutje Geluk
Laravel Version: 10.7.1
PHP Version: 8.2.3
Composer Version: 2.2.7
Environment: local
Debug Mode: ENABLED
URL: lutjegeluk.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Statamic
Addons: 6
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: dev-master PRO
Statamic Addons
doublethreedigital/guest-entries: 2.1.1
statamic/eloquent-driver: 1.2.0
studio1902/statamic-peak-browser-appearance: 2.0-beta.2
studio1902/statamic-peak-commands: 2.0-beta.1
studio1902/statamic-peak-seo: 2.0-beta.2
studio1902/statamic-peak-tools: 3.0-beta.2
When you have a date field in your form, it's gonna saved in the .md file as value, like:
date: 2021-08-20
But is should saved as prefix in the filename, like:
2021-08-20.slug.md
No response
Statamic 3.2.2 Pro
Laravel 8.58.0
PHP 7.4.4
doublethreedigital/guest-entries 1.0.2
When you use a title format on a collection together with a hidden title field you can't submit guest entries.
Workaround: send the title with a hidden field using the same title format in Antlers.
.
Environment
Application Name: Stichting Lutje Geluk
Laravel Version: 10.8.0
PHP Version: 8.2.3
Composer Version: 2.2.7
Environment: local
Debug Mode: ENABLED
URL: lutjegeluk.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: database
Statamic
Addons: 6
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: dev-master PRO
Statamic Addons
doublethreedigital/guest-entries: 2.1.2
statamic/eloquent-driver: 1.2.0
studio1902/statamic-peak-browser-appearance: 2.0-beta.2
studio1902/statamic-peak-commands: 2.0-beta.3
studio1902/statamic-peak-seo: 2.0-beta.2
studio1902/statamic-peak-tools: 3.0-beta.2
Apparently, sometimes date inputs aren't turned into dates properly. We can probably guess if it's a date by it's blueprint fieldtype.
No response
Latest
Ah, found an error:
Class DoubleThreeDigital\GuestEntries\Exceptions\AssetContainerNotFoundSpecified located in /vendor/doublethreedigital/guest-entries/src\Exceptions\AssetContainerNotSpecified.php does not comply with psr-4 autoloading standard. Skipping.
Originally posted by @wm-simon in #10 (comment)
The ability to upload files to an asset container (via an asset field) with Guest Entry forms.
Hey!
Ive been using Guest Entries with success but I may have found a possible edge-case that could use some thought. Hear me out please.
Many thanks in advance for the excellent addon and for any insights!
I have a listener set-up, listening for EntryCreated, so that when a File is attached to this field, it gets renamed and converted to JPG.
(...)
if ($event->entry->presentation_file) {
$name = 'presentation-' . $event->entry->title;
$filename = 'abstracts/' . $name . '.' . $event->entry->presentation_file->extension();
if ($event->entry->presentation_file->path() !== $filename) {
Log::info($event->entry->presentation_file->path());
Log::info($filename);
if (Storage::disk('assets')->exists($filename)) Storage::disk('assets')->delete($filename);
$new = $event->entry->presentation_file->rename($name); $filename
if (strtolower($new->extension()) === "pdf") {
$pdf = new Pdf($new->resolvedPath());
$pdf->saveImage($new->resolvedPath() . '.jpg');
}
}
}
(...)
It works fine on the CP.
Now, if i set up a Guest Entries, using file and save my attachment, the field becomes empty on the CP, despite the file was uploaded, renamed and even the JPG was processed. So the listener works, but in the end, the field is blank.
Heres what i found out:
The "culprit" was this: vendor/doublethreedigital/guest-entries/src/Http/Controllers/GuestEntryController.php
@164
We have:
(...)
// $entry->save();
$entry->touch();
(...)
If I comment save(), everything works as expected. Hmmm.
While trying to dive in further....
Looking at: vendor/statamic/cms/src/Data/TracksLastModified.php
@39
It seems that touch() also actually saves():
(...)
public function touch($user = null)
{
$this->updateLastModified($user)->save();
}
(...)
So I'm guessing having save() followed by touch() its either redundant and/or causes some bad behaviour on my listener by "double-triggering". But the funny thing is that if I actually log the actions on the Event Listener, they only happen ONCE even if I leave save() followed by touch().
What do you think? I hope that made any sense :)
Statamic 3.3.45 Pro
Laravel 8.83.25
PHP 8.0.24
anakadote/statamic-recaptcha 1.0.7
aryehraber/statamic-uuid 2.1.0
cnj/seotamic 2.1.0
doublethreedigital/guest-entries 1.2.2
optimoapps/statamic-bard-text-align 1.0.2
rias/statamic-data-import 1.2.2
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.