Code Monkey home page Code Monkey logo

sloth's People

Contributors

cmbsvk avatar daniellehardt avatar jochenwichmann avatar maxleistner avatar sixmonkey avatar smr-christofhardt avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sloth's Issues

Admin view shows too much information

If you add the type image to an acf field group and choose to get the values as an array, all the array values will be displayed within the admin view of the module. It would be nicer to show either the image itself or only the path to the image.

bildschirmfoto 2018-10-23 um 17 00 00

Class MENU does not work with multi-levels Menus

If a Menu is called all menu items are delivered on the same level, even if in the WordPress Admin the Menu is sorted like this f.e.:

  • Menu Item 1
    -- Menu Item 1.1
    -- Menu Item 1.2
  • Menu Item 2
  • Menut Item 3

A debug delivers any array with all items on the same level. Only the parent_item id is saved within the object.
It would be perfect if the Class Menu would deliver the submenu items as sub-items like it is done in the normal WordPress logic or Timber-Logic.

There might be a hint how this can be done here: https://github.com/corcel/corcel#multi-levels-menus

spatie/image requires spatie/temporay-directory --> leads to php version error

composer install on a php7.4 machine leads to the following error:

Installing dependencies (including require-dev) from lock file
output Your requirements could not be resolved to an installable set of packages.
output Problem 1
output - spatie/temporary-directory 2.0.0 requires php ^8.0 -> your PHP version (7.4.20) overridden by "config.platform.php" version (7.4.14) does not satisfy that requirement.
output - spatie/temporary-directory 2.0.0 requires php ^8.0 -> your PHP version (7.4.20) overridden by "config.platform.php" version (7.4.14) does not satisfy that requirement.
output - Installation request for spatie/temporary-directory 2.0.0 -> satisfiable by spatie/temporary-directory[2.0.0].

sloth asks for spatie/image version ^1.5 - should be a fixed version i guess?

Layotter View not found on custom post type

One of my plugins (WPSHOPIFY PRO) is generating a custom post type. If i try to publish this post it fails, after using the layotter and the following error appears in the frontend.

Within my theme folder, the single view is loaded by: views/poducts-single/php.twig

Bildschirmfoto 2020-05-18 um 08 43 29 (1)

Custom image sizes not working

Settings within the theme:

Configure::write(
	'theme.image-sizes',
	[
		'rel_teaser_box'       => [
			'width'   => 600,
			'height'  => 500,
			'crop'    => true,
			'upscale' => true,
		],
		'product_image_thumbs' => [
			'width'   => 400,
			'height'  => 400,
			'crop'    => true,
			'upscale' => true,
		],
	]
);

Call within twig template:

{{ slide.product_productImages_image.sizes.product_image_thumbs | print_r }}

or

{{ slide.product_productImages_image.getThemeSized('product_image_thumbs') | print_r }}

returns:

"http://localhost:4000/uploads/2020/04/Biryani-Rezepet-Huhn-Indien-1920x1080-1-mobile-crop-400x400.jpg" (100)
in .../sloth/src/View/Extensions/SlothTwigExtension.php:99

Calling the image itself return the following error:

Class 'League\Glide\ServerFactory' not found

Bildschirmfoto 2020-08-07 um 10 08 52

ACF field synchronization bug

ACF fields are not synchronized correctly. Changes to an acf field are not getting synchronized via sloth and are missing within the admin view. The acf json file gets replaced by the edited file, but i guess the database has still the old values. Maybe it is a problem with the trigger who pushes the changes from the file to the database?

Get layotter post_options

I am trying to get the layotter element options within a module. If i debug the result of $this->get( '_layotter.passed' ); i get the following:

class => "1/2" (3)
col_options => array ()
row_options => array (4)
larger_width => false
background_color => "bg-white" (8)
row_margin => "my-2" (4)
row_padding => "py-2 py-md-4" (12)
post_options => array ()

The post_option array should now contain a field, which should return an array of objects selected within the element options screen. But it does not.

How can i return the values of an element-options field within a module?

bildschirmfoto 2018-08-15 um 13 25 18

ACF File

Getting attachments from models via ACF is unhandy.
I have to use xxx.acf.file('acf-field-name').url.
It would be better if it would work like images.

BadMethodCallException Error (Illuminate)

Since an update of Illuminate the following error appears:

BadMethodCallException: Method Illuminate\Database\Query\Builder::getTaxonomy does not exist. in /var/www/vendor/illuminate/database/Query/Builder.php:2816
Stack trace:
#0 /var/www/vendor/illuminate/database/Eloquent/Builder.php(1286): Illuminate\Database\Query\Builder->__call()
#1 /var/www/vendor/illuminate/database/Eloquent/Model.php(1570): Illuminate\Database\Eloquent\Builder->__call()
#2 /var/www/vendor/sixmonkey/sloth/src/Plugin/Plugin.php(138): Illuminate\Database\Eloquent\Model->__call()
#3 /var/www/public/cms/wp-includes/class-wp-hook.php(287): Sloth\Plugin\Plugin->loadTaxonomies()
#4 /var/www/public/cms/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters()
#5 /var/www/public/cms/wp-includes/plugin.php(478): WP_Hook->do_action()
#6 /var/www/public/cms/wp-settings.php(540): do_action()
#7 /var/www/public/wp-config.php(13): require_once('/var/www/public...')
#8 /var/www/public/cms/wp-load.php(42): require_once('/var/www/public...')
#9 /var/www/sloth.php(22): include('/var/www/public...')
#10 {main}
(stored in /var/www//logs/exception--2020-04-14--20-37--eafbbf09cf.html)

If i'm on php 7.2 i get the error when trying to create a new module via vagrant ssh php sloth.php create-module if there are custom taxonomies.

If i'm on php 7.4 the error already loads on page load no matter which page 'm on

Bildschirmfoto 2020-05-15 um 10 08 57

wp-rest is broken

/wp-json/wp/v2/posts shows this error:

{
   code: "rest_post_invalid_page_number",
   message: "Die angeforderte Seitennummer ist größer als die Anzahl der verfügbaren Seiten.",
   data: {
      status: 400
   }
}

@maxleistner ;-)

Warning: Class Configure can't be declared

The following warning appears after every reload of a page in the /log/error.log

PHP Warning: Cannot declare class Configure, because the name is already in use in /var/www/html/vendor/sixmonkey/sloth/src/Core/Sloth.php:110

make possible to configure src directory

Currently when using the scaffolder like php sloth.php create-module it assumes a fix folder on projects root to be the target for autogenerated sass-files. that should be configurable, as the structure of a project might be different.

Object of class WP_Term could not be converted to string

How to generate the error:

  1. New ACF Field Group where one field is Taxonomy and has the return value ID.
  2. Add module with this ACF Field Group the a page and save the page.
  3. Change the return value of the ACF Field Group to Taxonomy Object
  4. Reload admin page of the page, where the module has been added

bildschirmfoto 2018-08-09 um 18 50 35
bildschirmfoto 2018-08-09 um 18 50 14

Author dropdown is missing by default

If there is no model for a post-type and/or you do not explicitly support the author within a model, the dropdown is missing from the wordpress admin single post-view.

After adding
'supports' => ['author']
to the Model options the dropdown appears again.

Therefore the default should be fixed if there is no model.

Pagination error

Pagination does not work within admin area or REST Api requests. Sloth overrides the pagination settings with a hacky solution which does lead to infinite per page results (-1).

Class 'Illuminate\Translation\ArrayLoader' not found

The following errors appear if a post is saved or an admin Ajax function is called.
Something within the Validation Class can't be called. May be a dependency problem.

exception.log

Error: Class 'Illuminate\Translation\ArrayLoader' not found in /var/www/html/vendor/sixmonkey/sloth/src/Validation/ValidationServiceProvider.php:15

error.log

PHP Warning: Cannot declare class Configure, because the name is already in use in /var/www/html/vendor/sixmonkey/sloth/src/Core/Sloth.php:110

View [pagination.default] not found.

If the method links() is called ($posts->links();) to generate the navigation bar for more pages in the blog, the following error occurs in Illuminate\Pagination\LengthAwarePaginator->links():
View [pagination.default] not found.
Call stack:

/html/vendor/illuminate/view/FileViewFinder.php:79	source  Illuminate\View\FileViewFinder->findInPaths(arguments)

/html/vendor/illuminate/view/Factory.php:128	source  Illuminate\View\FileViewFinder->find(arguments)

.../illuminate/pagination/LengthAwarePaginator.php:92	source  Illuminate\View\Factory->make(arguments)

.../illuminate/pagination/LengthAwarePaginator.php:78	source  Illuminate\Pagination\LengthAwarePaginator->render(arguments)

The same happens if the method is called directly in twig with

{{ posts.links }} 

worked before - does not any more (since commit f911f06)

Image: Trying to get property of non-object

PHP Notice: Trying to get property of non-object in /var/www/vendor/sixmonkey/sloth/src/Field/Image.php:64
PHP Notice: Trying to get property of non-object in /var/www/vendor/sixmonkey/sloth/src/Field/Image.php:265

images are missing their sizes array

I tried to get the 'large' or 'custom' url of an image size, but the array which should contain the sizes is empty. Might be related to the recent changes to the Image processing via sloth.

bildschirmfoto 2019-01-11 um 17 40 41

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.